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

Loading…
Cancel
Save