diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2011-03-30 02:29:47 +0200 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2011-03-30 02:53:08 +0200 |
commit | 6935db4ec2995e818e7202f26c6eb1f99a48dc54 (patch) | |
tree | d7cdc4aa62bc451f1d95ba38cd3b646f9f780cb8 /org.eclipse.jgit/src | |
parent | 153283f05adc7cd3da44d49d576ec2562ac76608 (diff) | |
download | jgit-6935db4ec2995e818e7202f26c6eb1f99a48dc54.tar.gz jgit-6935db4ec2995e818e7202f26c6eb1f99a48dc54.zip |
Let CloneCommand not checkout HEAD on bare repos
If the clone command clones into a bare repository it should not try
to checkout HEAD in the end. For bare repos checkout is not possible.
Change-Id: I359719d421b93c9d2e962e3c0eccc2b59235c3d1
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java index 0257f3264f..b41a44a0e3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java @@ -177,9 +177,12 @@ public class CloneCommand implements Callable<Git> { u.setNewObjectId(commit.getId()); u.forceUpdate(); - DirCache dc = repo.lockDirCache(); - DirCacheCheckout co = new DirCacheCheckout(repo, dc, commit.getTree()); - co.checkout(); + if (!bare) { + DirCache dc = repo.lockDirCache(); + DirCacheCheckout co = new DirCacheCheckout(repo, dc, + commit.getTree()); + co.checkout(); + } } private RevCommit parseCommit(final Repository repo, final Ref ref) |