]> source.dussan.org Git - jgit.git/commitdiff
ResolveMerge only needs to visit differing TreeEntries 62/44962/1
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 31 Mar 2015 15:33:31 +0000 (17:33 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 31 Mar 2015 15:33:31 +0000 (17:33 +0200)
This should considerably speed up the treewalk on larger repositories.

Found by discussing new EGit API to support model merge in change
eda23bb556d342f421f03b93c7faa160998598aa

Change-Id: I822721c76c64e614f87a080ced2457941f53adcd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
cc: Laurent Delaigue <laurent.delaigue@obeo.fr>

org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java

index 8e70f57fa3ab2a8badbb8588c03d2be9be0186b8..6b87e645f89e8213e036299f3a03e30fb1f5ac9c 100644 (file)
@@ -88,6 +88,7 @@ import org.eclipse.jgit.treewalk.CanonicalTreeParser;
 import org.eclipse.jgit.treewalk.NameConflictTreeWalk;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.eclipse.jgit.treewalk.WorkingTreeIterator;
+import org.eclipse.jgit.treewalk.filter.TreeFilter;
 import org.eclipse.jgit.util.FS;
 import org.eclipse.jgit.util.TemporaryBuffer;
 
@@ -1006,6 +1007,7 @@ public class ResolveMerger extends ThreeWayMerger {
                DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder);
 
                tw = new NameConflictTreeWalk(reader);
+               tw.setFilter(TreeFilter.ANY_DIFF);
                tw.addTree(baseTree);
                tw.addTree(headTree);
                tw.addTree(mergeTree);