aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
index 02960bf293..deecb8e15f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkPushConnection.java
@@ -220,9 +220,9 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
String pathPack = null;
String pathIdx = null;
- final PackWriter writer = new PackWriter(transport.getPackConfig(),
- local.newObjectReader());
- try {
+ try (final PackWriter writer = new PackWriter(transport.getPackConfig(),
+ local.newObjectReader())) {
+
final Set<ObjectId> need = new HashSet<ObjectId>();
final Set<ObjectId> have = new HashSet<ObjectId>();
for (final RemoteRefUpdate r : updates)
@@ -293,8 +293,6 @@ class WalkPushConnection extends BaseConnection implements PushConnection {
safeDelete(pathPack);
throw new TransportException(uri, JGitText.get().cannotStoreObjects, err);
- } finally {
- writer.release();
}
}