summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 17:02:34 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 17:02:34 +0900
commit5ac044abc009175765387b0450196b1d5dc027ab (patch)
treefe5e91cde802fc88959569da9a7fde70e9253f2e /org.eclipse.jgit.http.test
parent1a2db96c79f3e6fdf402ffa9f85f8e48303ac8ff (diff)
downloadjgit-5ac044abc009175765387b0450196b1d5dc027ab.tar.gz
jgit-5ac044abc009175765387b0450196b1d5dc027ab.zip
SmartClientSmartServerTest: Open TestRepository in try-with-resource
Change-Id: If1351920398f574b5b93be55868c157c3cd15290 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.test')
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java16
1 files 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<Repository> 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<Repository> tr = new TestRepository<>(
+ remoteRepository)) {
+ b = tr.branch(master);
+ Z = b.commit().message("Z").create();
+ }
// Now incrementally update.
//