Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-05 02:48:29 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-26 04:16:31 +0300
commitee213de22d15e801ba3712be0cb8ecbf7415fa1d (patch)
treec6f0cb0706e64e4d9fe00cb5fda4cd133e743767 /builtin/mktag.c
parentcdcaaec9a6028f53f9b44efb6dce9f15bb394b45 (diff)
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 'builtin/mktag.c')
-rw-r--r--builtin/mktag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 96a3686af5..98d1e66f32 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -97,7 +97,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
&tagged_oid, &tagged_type))
die(_("tag on stdin did not pass our strict fsck check"));
- if (verify_object_in_tag(&tagged_oid, &tagged_type))
+ if (verify_object_in_tag(&tagged_oid, &tagged_type) < 0)
die(_("tag on stdin did not refer to a valid object"));
if (write_object_file(buf.buf, buf.len, OBJ_TAG, &result) < 0)