Skip to content

Commit e61f227

Browse files
rscharfegitster
authored andcommitted
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>
1 parent 7c7698a commit e61f227

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tag.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,11 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u
148148
FREE_AND_NULL(item->tag);
149149
}
150150

151-
if (size < the_hash_algo->hexsz + 24)
151+
if (size < r->hash_algo->hexsz + 24)
152152
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')
154156
return -1;
155157

156158
if (!starts_with(bufptr, "type "))

0 commit comments

Comments
 (0)