mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
hash: require hash algorithm in is_empty_{blob,tree}_oid()
Both functions `is_empty_{blob,tree}_oid()` 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
861e8c76f6
commit
9c34eb93fb
10
hash.h
10
hash.h
@@ -6,14 +6,4 @@
|
||||
|
||||
#define the_hash_algo the_repository->hash_algo
|
||||
|
||||
static inline int is_empty_blob_oid(const struct object_id *oid)
|
||||
{
|
||||
return oideq(oid, the_hash_algo->empty_blob);
|
||||
}
|
||||
|
||||
static inline int is_empty_tree_oid(const struct object_id *oid)
|
||||
{
|
||||
return oideq(oid, the_hash_algo->empty_tree);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user