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>
tags/v0.10.1
Shawn O. Pearce 13 years ago
parent
commit
48e80698cf
1 changed files with 4 additions and 7 deletions
  1. 4
    7
      org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java

+ 4
- 7
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java View File

@@ -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