Permalink
Browse files

Issue 20: Switch CheckoutBuilder from GitIndex to using DirCache

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
  • Loading branch information...
1 parent 5c561c7 commit 1f1a7004c094b4e5b19f6391935d5ca70e8ad41c @jonas jonas committed Sep 19, 2009
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/org/nbgit/client/CheckoutBuilder.java
View
11 src/org/nbgit/client/CheckoutBuilder.java
@@ -44,8 +44,9 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import org.spearce.jgit.dircache.DirCache;
+import org.spearce.jgit.dircache.DirCacheEntry;
import org.spearce.jgit.lib.FileMode;
-import org.spearce.jgit.lib.GitIndex;
import org.spearce.jgit.lib.ObjectId;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.lib.Tree;
@@ -60,7 +61,7 @@
private final HashMap<RevisionEntry, File> fileMappings = new HashMap<RevisionEntry, File>();
private boolean backup;
private Tree tree;
- private GitIndex index;
+ private DirCache index;
private CheckoutBuilder(Repository repository) {
super(repository);
@@ -127,11 +128,11 @@ public CheckoutBuilder file(File file, File destination)
}
} else {
if (index == null)
- index = repository.getIndex();
- GitIndex.Entry entry = index.getEntry(path);
+ index = DirCache.read(repository);
+ DirCacheEntry entry = index.getEntry(path);
if (entry != null) {
blobId = entry.getObjectId();
- modeBits = entry.getModeBits();
+ modeBits = entry.getRawMode();
}
}
if (blobId == null)

0 comments on commit 1f1a700

Please sign in to comment.