mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 03:25:56 +01:00
Close diff formatter
This commit is contained in:
@@ -113,16 +113,17 @@ final class Differ implements AutoCloseable {
|
||||
}
|
||||
|
||||
private Diff diff(Repository repository) throws IOException {
|
||||
DiffFormatter diffFormatter = new DiffFormatter(null);
|
||||
diffFormatter.setRepository(repository);
|
||||
diffFormatter.setDetectRenames(true);
|
||||
if (pathFilter != null) {
|
||||
diffFormatter.setPathFilter(pathFilter);
|
||||
try (DiffFormatter diffFormatter = new DiffFormatter(null)) {
|
||||
diffFormatter.setRepository(repository);
|
||||
diffFormatter.setDetectRenames(true);
|
||||
if (pathFilter != null) {
|
||||
diffFormatter.setPathFilter(pathFilter);
|
||||
}
|
||||
List<DiffEntry> entries = diffFormatter.scan(
|
||||
treeWalk.getTree(0, AbstractTreeIterator.class),
|
||||
treeWalk.getTree(1, AbstractTreeIterator.class));
|
||||
return new Diff(commit, entries);
|
||||
}
|
||||
List<DiffEntry> entries = diffFormatter.scan(
|
||||
treeWalk.getTree(0, AbstractTreeIterator.class),
|
||||
treeWalk.getTree(1, AbstractTreeIterator.class));
|
||||
return new Diff(commit, entries);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user