hash: require hash algorithm in empty_tree_oid_hex()
The `empty_tree_oid_hex()` function 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. While at it, remove the unused `empty_blob_oid_hex()` function. 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
9c34eb93fb
commit
7abbca0e74
@ -227,16 +227,10 @@ const struct object_id *null_oid(void)
|
||||
return the_hash_algo->null_oid;
|
||||
}
|
||||
|
||||
const char *empty_tree_oid_hex(void)
|
||||
const char *empty_tree_oid_hex(const struct git_hash_algo *algop)
|
||||
{
|
||||
static char buf[GIT_MAX_HEXSZ + 1];
|
||||
return oid_to_hex_r(buf, the_hash_algo->empty_tree);
|
||||
}
|
||||
|
||||
const char *empty_blob_oid_hex(void)
|
||||
{
|
||||
static char buf[GIT_MAX_HEXSZ + 1];
|
||||
return oid_to_hex_r(buf, the_hash_algo->empty_blob);
|
||||
return oid_to_hex_r(buf, algop->empty_tree);
|
||||
}
|
||||
|
||||
int hash_algo_by_name(const char *name)
|
||||
|
||||
Reference in New Issue
Block a user