summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-12-15 16:14:19 -0800
committerChris Aniszczyk <caniszczyk@gmail.com>2010-12-20 09:28:29 -0600
commit0c22243c4a59560529e7bd271094837c0fbf5295 (patch)
tree37f36e8f25565b3c294139a23af2d1cb128c1122 /org.eclipse.jgit.pgm/src
parenta92bda5adfeb3da880ac3ec7e99753105c2e7607 (diff)
downloadjgit-0c22243c4a59560529e7bd271094837c0fbf5295.tar.gz
jgit-0c22243c4a59560529e7bd271094837c0fbf5295.zip
clone: Use DirCacheCheckout
This simple change lets us get rid of WorkDirCheckout from JGit, and all of its supporting code. Change-Id: I1a5aabe9ab4a2b156fd37cc7e9ededb4ed70f53a Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-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)