Browse Source

Revert "Close unfinished archive entries on error"

This reverts commit 75d9b31f14.
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 <jrn@google.com>
stable-3.2
Jonathan Nieder 11 years ago
parent
commit
3467e865ac
  1. 3
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
  2. 3
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java

3
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java

@ -93,12 +93,9 @@ public class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
} }
entry.setSize(loader.getSize()); entry.setSize(loader.getSize());
out.putArchiveEntry(entry); out.putArchiveEntry(entry);
try {
loader.copyTo(out); loader.copyTo(out);
} finally {
out.closeArchiveEntry(); out.closeArchiveEntry();
} }
}
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;

3
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java

@ -82,12 +82,9 @@ public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
} }
entry.setSize(loader.getSize()); entry.setSize(loader.getSize());
out.putArchiveEntry(entry); out.putArchiveEntry(entry);
try {
loader.copyTo(out); loader.copyTo(out);
} finally {
out.closeArchiveEntry(); out.closeArchiveEntry();
} }
}
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;

Loading…
Cancel
Save