From 5ac044abc009175765387b0450196b1d5dc027ab Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sun, 20 Jan 2019 17:02:34 +0900 Subject: [PATCH] SmartClientSmartServerTest: Open TestRepository in try-with-resource Change-Id: If1351920398f574b5b93be55868c157c3cd15290 Signed-off-by: David Pursehouse --- .../http/test/SmartClientSmartServerTest.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 83083f8a4e..fbc12e0c32 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -1008,8 +1008,12 @@ public class SmartClientSmartServerTest extends HttpTestCase { // Create a new commit on the remote. // - b = new TestRepository<>(remoteRepository).branch(master); - RevCommit Z = b.commit().message("Z").create(); + RevCommit Z; + try (TestRepository tr = new TestRepository<>( + remoteRepository)) { + b = tr.branch(master); + Z = b.commit().message("Z").create(); + } // Now incrementally update. // @@ -1068,8 +1072,12 @@ public class SmartClientSmartServerTest extends HttpTestCase { // Create a new commit on the remote. // - b = new TestRepository<>(remoteRepository).branch(master); - RevCommit Z = b.commit().message("Z").create(); + RevCommit Z; + try (TestRepository tr = new TestRepository<>( + remoteRepository)) { + b = tr.branch(master); + Z = b.commit().message("Z").create(); + } // Now incrementally update. // -- 2.39.5