From: Junio C Hamano Date: Wed, 08 Mar 2006 11:04:14 GMT Subject: Re: [PATCH] write_sha1_file(): Perform Z_FULL_FLUSH between header and data Message-ID: <7vhd69i4ep.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20060308134519.78ea313d.vsu@altlinux.ru> Sergey Vlasov writes: > However, a straight reuse still will not be possible, because > sha1write_compressed() uses deflateInit(&stream, Z_DEFAULT_COMPRESSION), > which writes zlib headers around the deflate stream, and the zlib footer > contains adler32 checksum. So, as a minimum, you will need to > decompress the object data, calculate its adler32 checksum and write the > zlib header yourself. Hmph. Thanks for helping, but it sounds like my original plan was not useful at all. Probably inflating would be still cheaper than inflating and then deflating, but it would not be as cool as a straight copy. Sigh...