diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-01 11:16:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-01 15:06:00 -0700 |
commit | bfff2c48330e95244a0ebdd7e0ba82fb77327347 (patch) | |
tree | e5202ee1bd1f3e0bf30b4960e05903bb52a1f305 /t/t4018/elixir-module | |
parent | object-file.c: don't set "typep" when returning non-zero (diff) | |
download | tgif-bfff2c48330e95244a0ebdd7e0ba82fb77327347.tar.xz |
object-file.c: return -1, not "status" from unpack_loose_header()
Return a -1 when git_inflate() fails instead of whatever Z_* status
we'd get from zlib.c. This makes no difference to any error we report,
but makes it more obvious that we don't care about the specific zlib
error codes here.
See d21f8426907 (unpack_sha1_header(): detect malformed object header,
2016-09-25) for the commit that added the "return status" code. As far
as I can tell there was never a real reason (e.g. different reporting)
for carrying down the "status" as opposed to "-1".
At the time that d21f8426907 was written there was a corresponding
"ret < Z_OK" check right after the unpack_sha1_header() call (the
"unpack_sha1_header()" function was later rename to our current
"unpack_loose_header()").
However, that check was removed in c84a1f3ed4d (sha1_file: refactor
read_object, 2017-06-21) without changing the corresponding return
code.
So let's do the minor cleanup of also changing this function to return
a -1.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4018/elixir-module')
0 files changed, 0 insertions, 0 deletions