Browse Source

Merge "Revert "Close unfinished archive entries on error""

stable-3.2
Dave Borowitz 11 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
17dc02a579
  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