Browse Source

Replace use of deprecated release() in BasePackPushConnection

Change-Id: I28a5c7e222daf35e3d1a1a6fda8ed6ef9b960f78
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.1
Matthias Sohn 10 years ago
parent
commit
6691c20bc2
  1. 10
      org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java

10
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java

@ -279,9 +279,8 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
Set<ObjectId> remoteObjects = new HashSet<ObjectId>();
Set<ObjectId> newObjects = new HashSet<ObjectId>();
final PackWriter writer = new PackWriter(transport.getPackConfig(),
local.newObjectReader());
try {
try (final PackWriter writer = new PackWriter(transport.getPackConfig(),
local.newObjectReader())) {
for (final Ref r : getRefs()) {
// only add objects that we actually have
@ -303,10 +302,9 @@ public abstract class BasePackPushConnection extends BasePackConnection implemen
writer.setDeltaBaseAsOffset(capableOfsDelta);
writer.preparePack(monitor, newObjects, remoteObjects);
writer.writePack(monitor, monitor, out);
} finally {
writer.release();
packTransferTime = writer.getStatistics().getTimeWriting();
}
packTransferTime = writer.getStatistics().getTimeWriting();
}
private void readStatusReport(final Map<String, RemoteRefUpdate> refUpdates)

Loading…
Cancel
Save