From ee213de22d15e801ba3712be0cb8ecbf7415fa1d Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Sat, 5 Feb 2022 00:48:29 +0100 Subject: object API users + docs: check <0, not !0 with check_object_signature() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- pack-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pack-check.c') 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) { -- cgit v1.2.3