diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-05 00:48:29 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-26 02:16:31 +0100 |
commit | ee213de22d15e801ba3712be0cb8ecbf7415fa1d (patch) | |
tree | c6f0cb0706e64e4d9fe00cb5fda4cd133e743767 /pack-check.c | |
parent | object API docs: move check_object_signature() docs to cache.h (diff) | |
download | git-ee213de22d15e801ba3712be0cb8ecbf7415fa1d.tar.xz git-ee213de22d15e801ba3712be0cb8ecbf7415fa1d.zip |
object API users + docs: check <0, not !0 with check_object_signature()
Change those users of the object API that misused
check_object_signature() by assuming it returned any non-zero when the
OID didn't match the expected value to check <0 instead. In practice
all of this code worked before, but it wasn't consistent with rest of
the users of the API.
Let's also clarify what the <0 return value means in API docs.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-check.c')
-rw-r--r-- | pack-check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-check.c b/pack-check.c index 3f418e3a6a..48d818ee7b 100644 --- a/pack-check.c +++ b/pack-check.c @@ -143,7 +143,7 @@ static int verify_packfile(struct repository *r, oid_to_hex(&oid), p->pack_name, (uintmax_t)entries[i].offset); else if (check_object_signature(r, &oid, data, size, - type_name(type), NULL)) + type_name(type), NULL) < 0) err = error("packed %s from %s is corrupt", oid_to_hex(&oid), p->pack_name); else if (fn) { |