Release any ObjectReaders created by JGit
RevWalk implicitly creates an ObjectReader if you call its Repository based constructor. Ensure we always release those ObjectReaders, or use our own that we can release when we are done. Change-Id: I6421507d248e331e7c35bdeb7831ea2f7bcff6b5 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -140,8 +140,12 @@ public class ScanTrackingIds extends SiteProgram {
|
||||
|
||||
private RevCommit parse(final Repository git, PatchSet ps)
|
||||
throws MissingObjectException, IncorrectObjectTypeException, IOException {
|
||||
return new RevWalk(git).parseCommit(ObjectId.fromString(ps.getRevision()
|
||||
.get()));
|
||||
RevWalk rw = new RevWalk(git);
|
||||
try {
|
||||
return rw.parseCommit(ObjectId.fromString(ps.getRevision().get()));
|
||||
} finally {
|
||||
rw.release();
|
||||
}
|
||||
}
|
||||
|
||||
private Change next() {
|
||||
|
Reference in New Issue
Block a user