.setOldTree(repository.index().getTree().getId())
.setNewTree(oldCommit.getTreeId()).setPathFilter(pattern);
Iterator<DiffEntry> diff = diffOp.call();
final long numChanges = Iterators.size(diffOp.call());
if (numChanges == 0) {
// We are reseting to the current version, so there is nothing to do. However,
// if we are in a conflict state, the conflict should be removed and calling
// stage() will not do it, so we do it here
repository.stagingDatabase().removeConflict(null, pattern);