/** * If no {@link #setOldVersion(String) old version} was set, returns the differences between the * working tree and the index, otherwise the differences between the working tree and the * specified revision. * * @return an iterator to a set of differences between the two trees * @see DiffEntry */ @Override protected AutoCloseableIterator<DiffEntry> _call() { final Optional<String> ref = Optional.fromNullable(refSpec); final RevTree oldTree = ref.isPresent() ? getOldTree() : stagingArea().getTree(); final RevTree newTree = workingTree().getTree(); DiffTree diff = command(DiffTree.class).setReportTrees(this.reportTrees) .setOldTree(oldTree.getId()).setNewTree(newTree.getId()).setMaxDiffs(limit) .setPreserveIterationOrder(preserveIterationOrder); if (this.pathFilter != null) { diff.setPathFilter(ImmutableList.of(pathFilter)); } return diff.call(); }
/** * If no {@link #setOldVersion(String) old version} was set, returns the differences between the * working tree and the index, otherwise the differences between the working tree and the * specified revision. * * @return an iterator to a set of differences between the two trees * @see DiffEntry */ @Override protected AutoCloseableIterator<DiffEntry> _call() { final Optional<String> ref = Optional.fromNullable(refSpec); final RevTree oldTree = ref.isPresent() ? getOldTree() : stagingArea().getTree(); final RevTree newTree = workingTree().getTree(); DiffTree diff = command(DiffTree.class).setReportTrees(this.reportTrees) .setOldTree(oldTree.getId()).setNewTree(newTree.getId()).setMaxDiffs(limit) .setPreserveIterationOrder(preserveIterationOrder); if (this.pathFilter != null) { diff.setPathFilter(ImmutableList.of(pathFilter)); } return diff.call(); }