From: Junio C Hamano Date: Mon, 21 Jan 2013 01:22:27 +0000 (-0800) Subject: Merge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ca7ccd5f46d1fa59d5361d04dd8cdf0422973016;p=git.git Merge branch 'rs/zip-with-uncompressed-size-in-the-header' into maint "git archive" did not record uncompressed size in the header when streaming a zip archive, which confused some implementations of unzip. * rs/zip-with-uncompressed-size-in-the-header: archive-zip: write uncompressed size into header even with streaming --- ca7ccd5f46d1fa59d5361d04dd8cdf0422973016 diff --cc archive-zip.c index 55f66b406,44b1dedd9..d3aef532b --- a/archive-zip.c +++ b/archive-zip.c @@@ -313,12 -276,9 +313,9 @@@ static int write_zip_entry(struct archi copy_le16(header.compression_method, method); copy_le16(header.mtime, zip_time); copy_le16(header.mdate, zip_date); - if (flags & ZIP_STREAM) - set_zip_header_data_desc(&header, 0, 0, 0); - else - set_zip_header_data_desc(&header, size, compressed_size, crc); + set_zip_header_data_desc(&header, size, compressed_size, crc); copy_le16(header.filename_length, pathlen); - copy_le16(header.extra_length, 0); + copy_le16(header.extra_length, ZIP_EXTRA_MTIME_SIZE); write_or_die(1, &header, ZIP_LOCAL_HEADER_SIZE); zip_offset += ZIP_LOCAL_HEADER_SIZE; write_or_die(1, path, pathlen);