Browse Source

PushConnectionTest: Open TestRepository in try-with-resource

Change-Id: I539b3acea8da914fc745e54b0bf104cf344c181c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
9b2779925c
  1. 17
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java

17
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java

@ -216,15 +216,16 @@ public class PushConnectionTest {
@Test @Test
public void commandOrder() throws Exception { public void commandOrder() throws Exception {
TestRepository<?> tr = new TestRepository<>(client);
List<RemoteRefUpdate> updates = new ArrayList<>(); List<RemoteRefUpdate> updates = new ArrayList<>();
// Arbitrary non-sorted order. try (TestRepository<?> tr = new TestRepository<>(client)) {
for (int i = 9; i >= 0; i--) { // Arbitrary non-sorted order.
String name = "refs/heads/b" + i; for (int i = 9; i >= 0; i--) {
tr.branch(name).commit().create(); String name = "refs/heads/b" + i;
RemoteRefUpdate rru = new RemoteRefUpdate(client, name, name, false, null, tr.branch(name).commit().create();
ObjectId.zeroId()); RemoteRefUpdate rru = new RemoteRefUpdate(client, name, name,
updates.add(rru); false, null, ObjectId.zeroId());
updates.add(rru);
}
} }
PushResult result; PushResult result;

Loading…
Cancel
Save