aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
diff options
context:
space:
mode:
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;