DeleteZombieCommentsRefsTest: Open RevWalk in try-with-resource
Change-Id: Ib151acaeca1d7c5e7371ccdd88b6c6e221a4a119
This commit is contained in:
@@ -176,7 +176,7 @@ public class DeleteZombieCommentsRefsTest {
|
|||||||
|
|
||||||
private static Ref createRefWithNonEmptyTreeCommit(Repository usersRepo, int changeId, int userId)
|
private static Ref createRefWithNonEmptyTreeCommit(Repository usersRepo, int changeId, int userId)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
RevWalk rw = new RevWalk(usersRepo);
|
try (RevWalk rw = new RevWalk(usersRepo)) {
|
||||||
ObjectId fileObj = createBlob(usersRepo, String.format("file %d content", changeId));
|
ObjectId fileObj = createBlob(usersRepo, String.format("file %d content", changeId));
|
||||||
ObjectId treeObj =
|
ObjectId treeObj =
|
||||||
createTree(usersRepo, rw.lookupBlob(fileObj), String.format("file%d.txt", changeId));
|
createTree(usersRepo, rw.lookupBlob(fileObj), String.format("file%d.txt", changeId));
|
||||||
@@ -184,6 +184,7 @@ public class DeleteZombieCommentsRefsTest {
|
|||||||
Ref refObj = createRef(usersRepo, commitObj, getRefName(changeId, userId));
|
Ref refObj = createRef(usersRepo, commitObj, getRefName(changeId, userId));
|
||||||
return refObj;
|
return refObj;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static Ref createRefWithEmptyTreeCommit(Repository usersRepo, int changeId, int userId)
|
private static Ref createRefWithEmptyTreeCommit(Repository usersRepo, int changeId, int userId)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
Reference in New Issue
Block a user