summaryrefslogtreecommitdiff
path: root/archive-zip.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-03-26 12:43:49 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-03-26 12:43:49 -0700
commit7d2726c3933538e5f256846a2bb38e1065c868b5 (patch)
treec1e2be1bc8c7cfb4c464637c7dc5f5e8986eb9e5 /archive-zip.c
parentMerge branch 'jk/utf-8-can-be-spelled-differently' into maint (diff)
parentarchive-zip: fix compressed size for stored export-subst files (diff)
downloadtgif-7d2726c3933538e5f256846a2bb38e1065c868b5.tar.xz
Merge branch 'rs/zip-compresssed-size-with-export-subst' into maint
When export-subst is used, "zip" output recorded incorrect size of the file. * rs/zip-compresssed-size-with-export-subst: archive-zip: fix compressed size for stored export-subst files
Diffstat (limited to 'archive-zip.c')
-rw-r--r--archive-zip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/archive-zip.c b/archive-zip.c
index d3aef532b7..a8d119305f 100644
--- a/archive-zip.c
+++ b/archive-zip.c
@@ -240,7 +240,6 @@ static int write_zip_entry(struct archiver_args *args,
(mode & 0111) ? ((mode) << 16) : 0;
if (S_ISREG(mode) && args->compression_level != 0 && size > 0)
method = 8;
- compressed_size = (method == 0) ? size : 0;
if (S_ISREG(mode) && type == OBJ_BLOB && !args->convert &&
size > big_file_threshold) {
@@ -259,6 +258,7 @@ static int write_zip_entry(struct archiver_args *args,
crc = crc32(crc, buffer, size);
out = buffer;
}
+ compressed_size = (method == 0) ? size : 0;
} else {
return error("unsupported file mode: 0%o (SHA1: %s)", mode,
sha1_to_hex(sha1));