Merge "Use try-with-resource to close resources in CloneCommand"
This commit is contained in:
commit
b2bba1419f
|
@ -322,12 +322,9 @@ private void addMergeConfig(Repository clonedRepo, Ref head)
|
|||
private RevCommit parseCommit(final Repository clonedRepo, final Ref ref)
|
||||
throws MissingObjectException, IncorrectObjectTypeException,
|
||||
IOException {
|
||||
final RevWalk rw = new RevWalk(clonedRepo);
|
||||
final RevCommit commit;
|
||||
try {
|
||||
try (final RevWalk rw = new RevWalk(clonedRepo)) {
|
||||
commit = rw.parseCommit(ref.getObjectId());
|
||||
} finally {
|
||||
rw.release();
|
||||
}
|
||||
return commit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue