Junio C Hamano wrote:
Nicolas Pitre [off-list ref] writes:
quoted
And the zlib header contains a CRC which we're about to use for
validating the data when doing delta data reuse in order to prevent pack
corruption propagation like the one recently posted on the list.
Ah, never thought of using the CRC directly. I was thinking
about inflating into void and see if it succeeds, which as you
say is perhaps quite expensive.
Unfortunately, the zlib CRC is of the _uncompressed_ data [1], so
inflating the stream is still necessary to check for corruption.
[1] RFC 1950, "ZLIB Compressed Data Format Specification", May 1996.
Pages 4-6.