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
@@ -29,11 +29,11 @@ static void add_sought_entry(struct ref ***sought, int *nr, int *alloc,
|
||||
; /* <oid>, leave oid as name */
|
||||
} else {
|
||||
/* <ref>, clear cruft from oid */
|
||||
oidclr(&oid);
|
||||
oidclr(&oid, the_repository->hash_algo);
|
||||
}
|
||||
} else {
|
||||
/* <ref>, clear cruft from get_oid_hex */
|
||||
oidclr(&oid);
|
||||
oidclr(&oid, the_repository->hash_algo);
|
||||
}
|
||||
|
||||
ref = alloc_ref(name);
|
||||
|
||||
Reference in New Issue
Block a user