From 75b31767c4d5db4883aa9b86c104d3cc8aa72b6d Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Thu, 28 Feb 2013 23:47:44 +0100 Subject: Do not report ignored directories as untracked Change-Id: I7e3f6b9fb1ac4b99d2cc9a78c63aad86f4fa5744 Signed-off-by: Matthias Sohn --- .../src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java index 1b231cce9d..c3323b8684 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/IndexDiffFilter.java @@ -132,6 +132,7 @@ public class IndexDiffFilter extends TreeFilter { IncorrectObjectTypeException, IOException { final int cnt = tw.getTreeCount(); final int wm = tw.getRawMode(workingTree); + WorkingTreeIterator wi = workingTree(tw); String path = tw.getPathString(); DirCacheIterator di = tw.getTree(dirCache, DirCacheIterator.class); @@ -148,7 +149,8 @@ public class IndexDiffFilter extends TreeFilter { // contain only untracked files and add it to // untrackedParentFolders. If we later find tracked files we will // remove it from this list - if (FileMode.TREE.equals(wm)) { + if (FileMode.TREE.equals(wm) + && !(honorIgnores && wi.isEntryIgnored())) { // Clean untrackedParentFolders. This potentially moves entries // from untrackedParentFolders to untrackedFolders copyUntrackedFolders(path); @@ -179,7 +181,6 @@ public class IndexDiffFilter extends TreeFilter { // we can avoid returning a result here, but only if its not in any // other tree. final int dm = tw.getRawMode(dirCache); - WorkingTreeIterator wi = workingTree(tw); if (dm == FileMode.TYPE_MISSING) { if (honorIgnores && wi.isEntryIgnored()) { ignoredPaths.add(wi.getEntryPathString()); -- cgit v1.2.3