tag: use algo of repo parameter in parse_tag_buffer()
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>
René Scharfe committed
Dec 28, 2025 at 19:10 UTC
e61f227d0654212412ce1835f7e432df85cfc36b
1 file changed
+4
-2
tag.c
+4
-2
@@ -148,9 +148,11 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u
148
FREE_AND_NULL(item->tag);
149
}
150
151
- if (size < the_hash_algo->hexsz + 24)
151
+ if (size < r->hash_algo->hexsz + 24)
152
return -1;
153
- if (memcmp("object ", bufptr, 7) || parse_oid_hex(bufptr + 7, &oid, &bufptr) || *bufptr++ != '\n')
153
+ if (memcmp("object ", bufptr, 7) ||
154
+ parse_oid_hex_algop(bufptr + 7, &oid, &bufptr, r->hash_algo) ||
155
+ *bufptr++ != '\n')
156
return -1;
157
158
if (!starts_with(bufptr, "type "))