Browse Source

ResolveMerge only needs to visit differing TreeEntries

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>
stable-4.1
Matthias Sohn 10 years ago
parent
commit
bda5e76420
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java

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

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

Loading…
Cancel
Save