From 48e80698cf7b19422cb7a62a34170cc3c7a3f7a2 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 7 Dec 2010 18:45:11 -0800 Subject: [PATCH] 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 --- .../src/org/eclipse/jgit/lib/IndexDiff.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java index 489e5c0cee..f532cdcf10 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java +++ b/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) { -- 2.39.5