summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-03-10 08:13:27 +0100
committerJunio C Hamano <gitster@pobox.com>2025-03-10 13:16:19 -0700
commitf6e174b2d8b83c17376b163fc4f8062fa3140a04 (patch)
tree70027c3b1bb65e0f6002aa560449242a37d84b51 /commit.c
parent1a6768d1dd6d92b34f25507091ff0775371e19cb (diff)
object-file-convert: stop depending on `the_repository`
There are multiple sites in "object-file-convert.c" where we use the global `the_repository` variable, either explicitly or implicitly by using `the_hash_algo`. All of these callsites are transitively called from `convert_object_file()`, which indeed has no repo as input. Refactor the function so that it receives a repository as a parameter and pass it through to all internal functions to get rid of the dependency. Remove the `USE_THE_REPOSITORY_VARIABLE` define. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 6efdb03997..48aeefaad3 100644
--- a/commit.c
+++ b/commit.c
@@ -1380,7 +1380,7 @@ static int convert_commit_extra_headers(const struct commit_extra_header *orig,
struct commit_extra_header *new;
CALLOC_ARRAY(new, 1);
if (!strcmp(orig->key, "mergetag")) {
- if (convert_object_file(&out, algo, compat,
+ if (convert_object_file(the_repository, &out, algo, compat,
orig->value, orig->len,
OBJ_TAG, 1)) {
free(new);