DiffObjectCount diffCount;
StagingDatabase index = stagingDatabase();
PreOrderDiffWalk visitor = new PreOrderDiffWalk(oldTree, newTree, index, index);
DiffCountConsumer counter = new DiffCountConsumer(index);
PreOrderDiffWalk.Consumer filter = counter;
if (!pathFilters.isEmpty()) {
filter = new PathFilteringDiffConsumer(pathFilters, counter);
}
visitor.walk(filter);
diffCount = counter.get();
return diffCount;
}