diff options
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) |