From 7abbca0e7470d1f7b6973933358c17022c6ee8a1 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 14 Jun 2024 08:50:18 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- add-patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'add-patch.c') diff --git a/add-patch.c b/add-patch.c index 814de57c4a..86181770f2 100644 --- a/add-patch.c +++ b/add-patch.c @@ -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`. */ -- cgit v1.2.3