diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-14 08:49:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-14 10:26:32 -0700 |
commit | 9da95bda74cf10e1475384a71fd20914c3b99784 (patch) | |
tree | fb145c3883d83c86ecf5bf7fa188937afe77b1e0 /cache-tree.c | |
parent | f4836570a7adbd8c70ad7a8edf6ae5a977647c06 (diff) |
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.c')
-rw-r--r-- | cache-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c index 387c0a3e5b..e4255c4d02 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -578,7 +578,8 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p) if (0 <= it->entry_count) { if (size < rawsz) goto free_return; - oidread(&it->oid, (const unsigned char *)buf); + oidread(&it->oid, (const unsigned char *)buf, + the_repository->hash_algo); buf += rawsz; size -= rawsz; } |