|
|
@ -322,12 +322,9 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> { |
|
|
|
private RevCommit parseCommit(final Repository clonedRepo, final Ref ref) |
|
|
|
private RevCommit parseCommit(final Repository clonedRepo, final Ref ref) |
|
|
|
throws MissingObjectException, IncorrectObjectTypeException, |
|
|
|
throws MissingObjectException, IncorrectObjectTypeException, |
|
|
|
IOException { |
|
|
|
IOException { |
|
|
|
final RevWalk rw = new RevWalk(clonedRepo); |
|
|
|
|
|
|
|
final RevCommit commit; |
|
|
|
final RevCommit commit; |
|
|
|
try { |
|
|
|
try (final RevWalk rw = new RevWalk(clonedRepo)) { |
|
|
|
commit = rw.parseCommit(ref.getObjectId()); |
|
|
|
commit = rw.parseCommit(ref.getObjectId()); |
|
|
|
} finally { |
|
|
|
|
|
|
|
rw.release(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return commit; |
|
|
|
return commit; |
|
|
|
} |
|
|
|
} |
|
|
|