From: Junio C Hamano Date: Sat, 12 Jan 2013 02:34:55 +0000 (-0800) Subject: Merge branch 'rs/zip-with-uncompressed-size-in-the-header' X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d9f85f50ca35d7ed1b35e2990a0082b94f1e1370;p=git.git Merge branch 'rs/zip-with-uncompressed-size-in-the-header' Improve compatibility of our zip output to fill uncompressed size in the header, which we can do without seeking back (even though it should not be necessary). * rs/zip-with-uncompressed-size-in-the-header: archive-zip: write uncompressed size into header even with streaming --- d9f85f50ca35d7ed1b35e2990a0082b94f1e1370 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);