Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java19
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java2
2 files changed, 2 insertions, 19 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java
index 6b445e4a5..6523c2376 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelCache.java
@@ -23,7 +23,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIText;
import org.eclipse.jgit.dircache.DirCache;
-import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.dircache.DirCacheIterator;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -37,11 +36,6 @@ import org.eclipse.jgit.treewalk.TreeWalk;
*/
public class GitModelCache extends GitModelObjectContainer {
- /**
- * NTH of {@link DirCacheIterator}
- */
- protected int dirCacheIteratorNth;
-
private final Path location;
private final FileModelFactory fileFactory;
@@ -146,8 +140,7 @@ public class GitModelCache extends GitModelObjectContainer {
* Creates and configures {@link TreeWalk} instance for
* {@link GitModelCache#getChildrenImpl()} method. It is IMPORTANT to add
* tree that will be used as a base as first, remote tree should be added as
- * second; {@link GitModelCache#dirCacheIteratorNth} should be set with
- * value of NTH that corresponds with {@link DirCacheIterator}.
+ * second;
*
* @return configured instance of TreeW
* @throws IOException
@@ -161,21 +154,11 @@ public class GitModelCache extends GitModelObjectContainer {
ObjectId headId = repo.getRef(Constants.HEAD).getObjectId();
tw.addTree(new RevWalk(repo).parseTree(headId));
tw.addTree(new DirCacheIterator(index));
- dirCacheIteratorNth = 1;
return tw;
}
private GitModelObject extractFromCache(TreeWalk tw) throws IOException {
- DirCacheIterator cacheIterator = tw.getTree(dirCacheIteratorNth,
- DirCacheIterator.class);
- if (cacheIterator == null)
- return null;
-
- DirCacheEntry cacheEntry = cacheIterator.getDirCacheEntry();
- if (cacheEntry == null)
- return null;
-
if (shouldIncludeEntry(tw)) {
String path = tw.getPathString();
ObjectId repoId = tw.getObjectId(BASE_NTH);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java
index ea55f426b..7bea8e947 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelWorkingTree.java
@@ -57,8 +57,8 @@ public class GitModelWorkingTree extends GitModelCache {
tw.setRecursive(true);
Repository repo = getRepository();
- dirCacheIteratorNth = tw.addTree(new DirCacheIterator(repo.readDirCache()));
int ftIndex = tw.addTree(new FileTreeIterator(repo));
+ int dirCacheIteratorNth = tw.addTree(new DirCacheIterator(repo.readDirCache()));
IndexDiffFilter idf = new IndexDiffFilter(dirCacheIteratorNth, ftIndex, true);
tw.setFilter(idf);

Back to the top