Skip to content

Commit 4bf4bda

Browse files
Philip Oakleydscho
authored andcommitted
index-pack.c: split bad object error messages
Tell the developer which condition failed. Signed-off-by: Philip Oakley <[email protected]>
1 parent 2ea5193 commit 4bf4bda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

builtin/index-pack.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,12 @@ static void *unpack_entry_data(off_t offset, size_t size,
461461
stream.avail_out = sizeof(fixed_buf);
462462
}
463463
} while (status == Z_OK);
464-
if (stream.total_out != size || status != Z_STREAM_END)
465-
bad_object(offset, _("inflate returned %d"), status);
464+
if (stream.total_out != size)
465+
// BUGS OUT HERE
466+
bad_object(offset, _("stream.total_out != size: inflate returned %d"), status);
467+
if (status != Z_STREAM_END)
468+
// BUGS OUT HERE
469+
bad_object(offset, _("status != Z_STREAM_END: inflate returned %d"), status);
466470
git_inflate_end(&stream);
467471
if (oid)
468472
the_hash_algo->final_fn(oid->hash, &c);

0 commit comments

Comments
 (0)