summaryrefslogtreecommitdiff
path: root/.mailmap
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2013-03-15 22:21:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-17 05:07:02 (GMT)
commitc3c2e1a09b84dc932d90fa09d1632e5efa34c940 (patch)
tree35f5ce56cefcb5118af51427214da4155f0fc4f2 /.mailmap
parentd3c1472fe35e2575508d80415565822ee2211df5 (diff)
downloadgit-c3c2e1a09b84dc932d90fa09d1632e5efa34c940.zip
git-c3c2e1a09b84dc932d90fa09d1632e5efa34c940.tar.gz
git-c3c2e1a09b84dc932d90fa09d1632e5efa34c940.tar.bz2
archive-zip: use deflateInit2() to ask for raw compressed data
We use the function git_deflate_init() -- which wraps the zlib function deflateInit() -- to initialize compression of ZIP file entries. This results in compressed data prefixed with a two-bytes long header and followed by a four-bytes trailer. ZIP file entries consist of ZIP headers and raw compressed data instead, so we remove the zlib wrapper before writing the result. We can ask zlib for the the raw compressed data without the unwanted parts in the first place by using deflateInit2() and specifying a negative number of bits to size the window. For that purpose, factor out the function do_git_deflate_init() and add git_deflate_init_raw(), which wraps it. Then use the latter in archive-zip.c and get rid of the code that stripped the zlib header and trailer. Also rename the helper function zlib_deflate() to zlib_deflate_raw() to reflect the change. Thus we avoid generating data that we throw away anyway, the code becomes shorter and some magic constants are removed. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '.mailmap')
0 files changed, 0 insertions, 0 deletions