@Override
protected DiffObjectCount _call() {
checkState(oldRefSpec != null || oldTreeId != null || oldTree != null,
"old ref spec not provided");
checkState(newRefSpec != null || newTreeId != null || newTree != null,
"new ref spec not provided");
final ObjectStore leftSource = this.leftSource == null ? objectDatabase() : this.leftSource;
final ObjectStore rightSource = this.rightSource == null ? objectDatabase()
: this.rightSource;
final RevTree oldTree = getTree(oldRefSpec, oldTreeId, this.oldTree, leftSource);
final RevTree newTree = getTree(newRefSpec, newTreeId, this.newTree, rightSource);
DiffObjectCount diffCount;
PreOrderDiffWalk visitor = new PreOrderDiffWalk(oldTree, newTree, leftSource, rightSource);
DiffCountConsumer counter = new DiffCountConsumer(leftSource, rightSource);
PreOrderDiffWalk.Consumer filter = counter;
if (!pathFilters.isEmpty()) {
filter = new PathFilteringDiffConsumer(pathFilters, counter);
}
visitor.walk(filter);
diffCount = counter.get();
return diffCount;
}