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 --- object-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'object-file.c') diff --git a/object-file.c b/object-file.c index 44e0b32d71..d628f58c0d 100644 --- a/object-file.c +++ b/object-file.c @@ -2613,7 +2613,7 @@ int read_loose_object(const char *path, } if (check_object_signature(the_repository, expected_oid, *contents, *size, - oi->type_name->buf, real_oid)) + oi->type_name->buf, real_oid) < 0) goto out; } -- cgit 1.2.3-korg