Browse Source

IndexDiff: Remove always true not-subtree check

The TreeWalk is configured to be recursive, which means subtrees are
never presented to the application.  Therefore the working tree file
mode can never be a subtree/subdirectory at this point in the code.

Change-Id: Ie842ddc147957d09205c0d2ce87b25c566862fd9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.10
Shawn O. Pearce 14 years ago
parent
commit
48e80698cf
  1. 11
      org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java

11
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java

@ -191,7 +191,6 @@ public class IndexDiff {
DirCacheIterator.class); DirCacheIterator.class);
WorkingTreeIterator workingTreeIterator = treeWalk.getTree(WORKDIR, WorkingTreeIterator workingTreeIterator = treeWalk.getTree(WORKDIR,
WorkingTreeIterator.class); WorkingTreeIterator.class);
FileMode fileModeTree = treeWalk.getFileMode(TREE);
if (dirCacheIterator != null) { if (dirCacheIterator != null) {
if (dirCacheIterator.getDirCacheEntry().isAssumeValid()) if (dirCacheIterator.getDirCacheEntry().isAssumeValid())
@ -208,12 +207,10 @@ public class IndexDiff {
} }
} else { } else {
// in repo, not in index => removed // in repo, not in index => removed
if (!fileModeTree.equals(FileMode.TYPE_TREE)) { removed.add(treeWalk.getPathString());
removed.add(treeWalk.getPathString()); changesExist = true;
changesExist = true; if (workingTreeIterator != null)
if (workingTreeIterator != null) untracked.add(treeWalk.getPathString());
untracked.add(treeWalk.getPathString());
}
} }
} else { } else {
if (dirCacheIterator != null) { if (dirCacheIterator != null) {

Loading…
Cancel
Save