summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
index 8eccdedc3f..903f2e889d 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
@@ -51,18 +51,17 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheCheckout;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.GitIndex;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefComparator;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.TextProgressMonitor;
-import org.eclipse.jgit.lib.Tree;
-import org.eclipse.jgit.lib.WorkDirCheckout;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.storage.file.FileBasedConfig;
@@ -187,13 +186,9 @@ class Clone extends AbstractFetchCommand {
u.setNewObjectId(commit);
u.forceUpdate();
- final GitIndex index = new GitIndex(db);
- final Tree tree = db.mapTree(commit.getTree());
- final WorkDirCheckout co;
-
- co = new WorkDirCheckout(db, db.getWorkTree(), index, tree);
+ DirCache dc = db.lockDirCache();
+ DirCacheCheckout co = new DirCacheCheckout(db, dc, commit.getTree());
co.checkout();
- index.write();
}
private RevCommit parseCommit(final Ref branch)