]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tag: use algo of repo parameter in parse_tag_buffer()
authorRené Scharfe <l.s.r@web.de>
Sun, 28 Dec 2025 18:10:48 +0000 (19:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Dec 2025 13:02:53 +0000 (22:02 +0900)
Stop using "the_hash_algo" explicitly and implictly via parse_oid_hex()
and instead use the "hash_algo" member of the passed in repository,
which is more correct.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tag.c

diff --git a/tag.c b/tag.c
index f5c232d2f1f36cecad575a612d5bb4bbf27ddffc..dec5ea8eb0ab7402bcc577a6687941d20db4b073 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -148,9 +148,11 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u
                FREE_AND_NULL(item->tag);
        }
 
-       if (size < the_hash_algo->hexsz + 24)
+       if (size < r->hash_algo->hexsz + 24)
                return -1;
-       if (memcmp("object ", bufptr, 7) || parse_oid_hex(bufptr + 7, &oid, &bufptr) || *bufptr++ != '\n')
+       if (memcmp("object ", bufptr, 7) ||
+           parse_oid_hex_algop(bufptr + 7, &oid, &bufptr, r->hash_algo) ||
+           *bufptr++ != '\n')
                return -1;
 
        if (!starts_with(bufptr, "type "))