Browse Source

HttpTestCase#fsck: Open TestRepository in try-with-resource

Change-Id: Ibda8c9970322871abf0fcf1244977bed04eaedd2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
tags/v5.3.0.201903061415-rc1
David Pursehouse 5 years ago
parent
commit
b465657238

+ 4
- 3
org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/HttpTestCase.java View File

@@ -186,9 +186,10 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
*/
protected static void fsck(Repository db, RevObject... tips)
throws Exception {
TestRepository<? extends Repository> tr =
new TestRepository<>(db);
tr.fsck(tips);
try (TestRepository<? extends Repository> tr =
new TestRepository<>(db)) {
tr.fsck(tips);
}
}

/**

Loading…
Cancel
Save