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>
This commit is contained in:
committed by
Junio C Hamano
parent
f4836570a7
commit
9da95bda74
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user