@matheusbsbs / matheus-bagliano / commits / 8c3c7b2adb
Fork 0

pack-objects: remove redundant and wrong call to deflateEnd()

We somehow called deflateEnd() on a stream that we have called deflateEnd() on already. In fact, the second deflateEnd() has always been returning Z_STREAM_ERROR. We just never checked the error return from that particular deflateEnd(). The first one returns 0 for success. We might want to tighten the check even more to check that. Noticed by Marco. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 10, 2008 at 23:26 UTC 8c3c7b2adbac9d4fce1fcec0ca03cfb6535d5af3
1 file changed +1 -1
builtin-pack-objects.c
+1 -1
@@ -445,7 +445,7 @@ static unsigned long write_object(struct sha1file *f,
445 /* nothing */;
446 deflateEnd(&stream);
447 datalen = stream.total_out;
448 - deflateEnd(&stream);
448 +
449 /*
450 * The object header is a byte of 'type' followed by zero or
451 * more bytes of length.