mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
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>
This commit is contained in:
parent
7c7698a654
commit
e61f227d06
6
tag.c
6
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 "))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user