MeasurePackSizeTest: Open Transport in try-with-resource
Change-Id: If9a39f8eabe1cd3474bdc025ac92218cd2dd1640 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
658c7c179d
commit
057a295f0c
|
@ -144,11 +144,9 @@ public void testPush_packSize() throws Exception {
|
|||
final RevCommit Q = src.commit().add("Q", Q_txt).create();
|
||||
final Repository db = src.getRepository();
|
||||
final String dstName = Constants.R_HEADS + "new.branch";
|
||||
Transport t;
|
||||
PushResult result;
|
||||
|
||||
t = Transport.open(db, remoteURI);
|
||||
try {
|
||||
try (Transport t = Transport.open(db, remoteURI)) {
|
||||
final String srcExpr = Q.name();
|
||||
final boolean forceUpdate = false;
|
||||
final String localName = null;
|
||||
|
@ -158,8 +156,6 @@ public void testPush_packSize() throws Exception {
|
|||
srcExpr, dstName, forceUpdate, localName, oldId);
|
||||
result = t.push(NullProgressMonitor.INSTANCE,
|
||||
Collections.singleton(update));
|
||||
} finally {
|
||||
t.close();
|
||||
}
|
||||
assertEquals("expected 1 RemoteUpdate", 1, result.getRemoteUpdates()
|
||||
.size());
|
||||
|
|
Loading…
Reference in New Issue