Browse Source

SmartClientSmartServerTest: Open TestRepository in try-with-resource

Change-Id: If1351920398f574b5b93be55868c157c3cd15290
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
5ac044abc0
  1. 16
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

16
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. // Create a new commit on the remote.
// //
b = new TestRepository<>(remoteRepository).branch(master); RevCommit Z;
RevCommit Z = b.commit().message("Z").create(); try (TestRepository<Repository> tr = new TestRepository<>(
remoteRepository)) {
b = tr.branch(master);
Z = b.commit().message("Z").create();
}
// Now incrementally update. // Now incrementally update.
// //
@ -1068,8 +1072,12 @@ public class SmartClientSmartServerTest extends HttpTestCase {
// Create a new commit on the remote. // Create a new commit on the remote.
// //
b = new TestRepository<>(remoteRepository).branch(master); RevCommit Z;
RevCommit Z = b.commit().message("Z").create(); try (TestRepository<Repository> tr = new TestRepository<>(
remoteRepository)) {
b = tr.branch(master);
Z = b.commit().message("Z").create();
}
// Now incrementally update. // Now incrementally update.
// //

Loading…
Cancel
Save