From 3467e865acac2f923b5d24b2084ae8a8a1f1e7ba Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 23 Sep 2013 17:35:15 -0700 Subject: [PATCH] Revert "Close unfinished archive entries on error" This reverts commit 75d9b31f14d6226a535a80c05cffda29e55d2ceb. Now that we do not try to close the ArchiveOutputStream in the error path, there is no need to artificially close partial entries from before the error. Change-Id: I1f1cb08ec4e9b14c79bf4621f3fa959463034b82 Signed-off-by: Jonathan Nieder --- .../src/org/eclipse/jgit/archive/TarFormat.java | 7 ++----- .../src/org/eclipse/jgit/archive/ZipFormat.java | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java index f90573ebc..23f4beda1 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java @@ -93,11 +93,8 @@ public class TarFormat implements ArchiveCommand.Format { } entry.setSize(loader.getSize()); out.putArchiveEntry(entry); - try { - loader.copyTo(out); - } finally { - out.closeArchiveEntry(); - } + loader.copyTo(out); + out.closeArchiveEntry(); } public Iterable suffixes() { diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java index be7264bd8..00c962bc9 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java +++ b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java @@ -82,11 +82,8 @@ public class ZipFormat implements ArchiveCommand.Format { } entry.setSize(loader.getSize()); out.putArchiveEntry(entry); - try { - loader.copyTo(out); - } finally { - out.closeArchiveEntry(); - } + loader.copyTo(out); + out.closeArchiveEntry(); } public Iterable suffixes() {