mirror of
https://github.com/git/git.git
synced 2025-09-10 22:44:50 +02:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
1a6768d1dd
commit
f6e174b2d8
2
commit.c
2
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);
|
||||
|
||||
Reference in New Issue
Block a user