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
@ -2361,7 +2361,9 @@ static void file_change_m(const char *p, struct branch *b)
|
||||
parse_path_eol(&path, p, "path");
|
||||
|
||||
/* Git does not track empty, non-toplevel directories. */
|
||||
if (S_ISDIR(mode) && is_empty_tree_oid(&oid) && *path.buf) {
|
||||
if (S_ISDIR(mode) &&
|
||||
is_empty_tree_oid(&oid, the_repository->hash_algo) &&
|
||||
*path.buf) {
|
||||
tree_content_remove(&b->branch_tree, path.buf, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user