From fb7b94313a21ffb1458cfb5fe1c6aeabc36fe387 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sun, 20 Jan 2019 15:00:08 +0900 Subject: [PATCH] DumbClientSmartServerTest: Open TestRepository in try-with-resource Change-Id: Ica172a85ec9b7da1416ff1b22699809f2c8c9df7 Signed-off-by: David Pursehouse --- .../eclipse/jgit/http/test/DumbClientSmartServerTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java index 5fdc10e73..2d22bafd8 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java @@ -215,7 +215,10 @@ public class DumbClientSmartServerTest extends HttpTestCase { @Test public void testInitialClone_Packed() throws Exception { - new TestRepository<>(remoteRepository).packAndPrune(); + try (TestRepository tr = new TestRepository<>( + remoteRepository)) { + tr.packAndPrune(); + } Repository dst = createBareRepository(); assertFalse(dst.getObjectDatabase().has(A_txt));