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. 7
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java

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

@ -216,16 +216,17 @@ public class PushConnectionTest {
@Test
public void commandOrder() throws Exception {
TestRepository<?> tr = new TestRepository<>(client);
List<RemoteRefUpdate> updates = new ArrayList<>();
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());
RemoteRefUpdate rru = new RemoteRefUpdate(client, name, name,
false, null, ObjectId.zeroId());
updates.add(rru);
}
}
PushResult result;
try (Transport tn = testProtocol.open(uri, client, "server")) {

Loading…
Cancel
Save