test-lib-functions: make 'test_cmp_rev' more informative on failure
[gitweb.git] / sha1-file.c
index 4a67e0e75945e362c64061f56f1ccb959396f102..5bd11c85bc563618b59dad3ff06e5ae5296c892b 100644 (file)
@@ -2199,7 +2199,8 @@ static int check_stream_sha1(git_zstream *stream,
         * see the comment in unpack_sha1_rest for details.
         */
        while (total_read <= size &&
-              (status == Z_OK || status == Z_BUF_ERROR)) {
+              (status == Z_OK ||
+               (status == Z_BUF_ERROR && !stream->avail_out))) {
                stream->next_out = buf;
                stream->avail_out = sizeof(buf);
                if (size - total_read < stream->avail_out)