From 298486a7c320629de12f9506e0133686a7382b01 Mon Sep 17 00:00:00 2001 From: Bernard Leach Date: Fri, 29 Apr 2011 19:42:10 +1000 Subject: IndexDiff: conflicting files aren't properly shown Before this change any files in the conflicting set would also be listed in the the other IndexDiff Sets which is confusing. With this change a conflicting file will not be included in any of the other sets. Change-Id: Ife9f2652685220bcfddc1f9820423acdcd5acfdc Signed-off-by: Chris Aniszczyk --- org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib') 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 b2c05ae5f7..0b23b23bdd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java @@ -286,6 +286,15 @@ public class IndexDiff { WorkingTreeIterator workingTreeIterator = treeWalk.getTree(WORKDIR, WorkingTreeIterator.class); + if (dirCacheIterator != null) { + final DirCacheEntry dirCacheEntry = dirCacheIterator + .getDirCacheEntry(); + if (dirCacheEntry != null && dirCacheEntry.getStage() > 0) { + conflicts.add(treeWalk.getPathString()); + continue; + } + } + if (treeIterator != null) { if (dirCacheIterator != null) { if (!treeIterator.idEqual(dirCacheIterator) @@ -324,12 +333,6 @@ public class IndexDiff { modified.add(treeWalk.getPathString()); } } - - final DirCacheEntry dirCacheEntry = dirCacheIterator - .getDirCacheEntry(); - if (dirCacheEntry != null && dirCacheEntry.getStage() > 0) { - conflicts.add(treeWalk.getPathString()); - } } } -- cgit v1.2.3