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>
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;
DirCacheBuildIterator buildIt = new DirCacheBuildIterator(builder);
tw = new NameConflictTreeWalk(reader);
+ tw.setFilter(TreeFilter.ANY_DIFF);
tw.addTree(baseTree);
tw.addTree(headTree);
tw.addTree(mergeTree);