From 9da95bda74cf10e1475384a71fd20914c3b99784 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 14 Jun 2024 08:49:54 +0200 Subject: hash: require hash algorithm in `oidread()` and `oidclr()` Both `oidread()` and `oidclr()` use `the_repository` to derive the hash function that shall be used. Require callers to pass in the hash algorithm to get rid of this implicit dependency. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- builtin/pack-objects.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'builtin/pack-objects.c') diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 638f5c57f0..2b00983a99 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2078,7 +2078,8 @@ static void check_object(struct object_entry *entry, uint32_t object_index) oidread(&base_ref, use_pack(p, &w_curs, entry->in_pack_offset + used, - NULL)); + NULL), + the_repository->hash_algo); have_base = 1; } entry->in_pack_header_size = used + the_hash_algo->rawsz; -- cgit 1.2.3-korg