diff options
| author | René Scharfe <l.s.r@web.de> | 2025-12-28 19:10:48 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-12-29 22:02:53 +0900 |
| commit | e61f227d0654212412ce1835f7e432df85cfc36b (patch) | |
| tree | ea20819e18a0516eae769029653e4ba7e9eff97c | |
| parent | 7c7698a654a7a0031f65b0ab0c1c4e438e95df60 (diff) | |
| download | git-e61f227d0654212412ce1835f7e432df85cfc36b.tar.xz | |
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>
| -rw-r--r-- | tag.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 ")) |
