mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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
@@ -420,7 +420,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
|
||||
/* could be on an unborn branch */
|
||||
!strcmp("HEAD", s->revision) &&
|
||||
repo_get_oid(the_repository, "HEAD", &oid) ?
|
||||
empty_tree_oid_hex() : s->revision);
|
||||
empty_tree_oid_hex(the_repository->hash_algo) : s->revision);
|
||||
}
|
||||
color_arg_index = args.nr;
|
||||
/* Use `--no-color` explicitly, just in case `diff.color = always`. */
|
||||
|
||||
Reference in New Issue
Block a user