aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 17:34:21 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-01-20 17:34:21 +0900
commit9b2779925cc0dff7779f129e6661a046af7b19f3 (patch)
treeb2147622753e172d420c3dd505e21b01344f169e /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
parentd7f4e6d1a1d74bcc8b0e86e0f6c4633f57159c24 (diff)
downloadjgit-9b2779925cc0dff7779f129e6661a046af7b19f3.tar.gz
jgit-9b2779925cc0dff7779f129e6661a046af7b19f3.zip
PushConnectionTest: Open TestRepository in try-with-resource
Change-Id: I539b3acea8da914fc745e54b0bf104cf344c181c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
index 63478f6f92..cea432e34c 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
@@ -216,15 +216,16 @@ public class PushConnectionTest {
@Test
public void commandOrder() throws Exception {
- TestRepository<?> tr = new TestRepository<>(client);
List<RemoteRefUpdate> updates = new ArrayList<>();
- // Arbitrary non-sorted order.
- for (int i = 9; i >= 0; i--) {
- String name = "refs/heads/b" + i;
- tr.branch(name).commit().create();
- RemoteRefUpdate rru = new RemoteRefUpdate(client, name, name, false, null,
- ObjectId.zeroId());
- updates.add(rru);
+ try (TestRepository<?> tr = new TestRepository<>(client)) {
+ // Arbitrary non-sorted order.
+ for (int i = 9; i >= 0; i--) {
+ String name = "refs/heads/b" + i;
+ tr.branch(name).commit().create();
+ RemoteRefUpdate rru = new RemoteRefUpdate(client, name, name,
+ false, null, ObjectId.zeroId());
+ updates.add(rru);
+ }
}
PushResult result;