]> source.dussan.org Git - jgit.git/commitdiff
Revert "Close unfinished archive entries on error" 10/16710/1
authorJonathan Nieder <jrn@google.com>
Tue, 24 Sep 2013 00:35:15 +0000 (17:35 -0700)
committerJonathan Nieder <jrn@google.com>
Tue, 24 Sep 2013 00:35:15 +0000 (17:35 -0700)
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 <jrn@google.com>
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java

index f90573ebc86caa7e74438ea2ce46774733b19bdb..23f4beda1448961a81fbc6333c086ac38f9bb7c5 100644 (file)
@@ -93,11 +93,8 @@ public class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
                }
                entry.setSize(loader.getSize());
                out.putArchiveEntry(entry);
-               try {
-                       loader.copyTo(out);
-               } finally {
-                       out.closeArchiveEntry();
-               }
+               loader.copyTo(out);
+               out.closeArchiveEntry();
        }
 
        public Iterable<String> suffixes() {
index be7264bd8b386e3fa3d50ea283e7912c717f6d31..00c962bc9827f71beef9498cb4459420d8d8fcd7 100644 (file)
@@ -82,11 +82,8 @@ public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
                }
                entry.setSize(loader.getSize());
                out.putArchiveEntry(entry);
-               try {
-                       loader.copyTo(out);
-               } finally {
-                       out.closeArchiveEntry();
-               }
+               loader.copyTo(out);
+               out.closeArchiveEntry();
        }
 
        public Iterable<String> suffixes() {