summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.archive
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.archive')
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java7
-rw-r--r--org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java7
2 files changed, 10 insertions, 4 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 23f4beda14..cd98c03393 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,8 +93,11 @@ public class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
}
entry.setSize(loader.getSize());
out.putArchiveEntry(entry);
- loader.copyTo(out);
- out.closeArchiveEntry();
+ try {
+ loader.copyTo(out);
+ } finally {
+ out.closeArchiveEntry();
+ }
}
public Iterable<String> 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 00c962bc98..be7264bd8b 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,8 +82,11 @@ public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
}
entry.setSize(loader.getSize());
out.putArchiveEntry(entry);
- loader.copyTo(out);
- out.closeArchiveEntry();
+ try {
+ loader.copyTo(out);
+ } finally {
+ out.closeArchiveEntry();
+ }
}
public Iterable<String> suffixes() {