Skip to content

Commit c5f3cba

Browse files
stefanbellergitster
authored andcommitted
submodule.c: use GIT_DIR_ENVIRONMENT consistently
In C code we have the luxury of having constants for all the important things that are hard coded. This is the only place in C that hard codes the git directory environment variable, so fix it. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e05806d commit c5f3cba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

submodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,5 +1333,6 @@ void prepare_submodule_repo_env(struct argv_array *out)
13331333
if (strcmp(*var, CONFIG_DATA_ENVIRONMENT))
13341334
argv_array_push(out, *var);
13351335
}
1336-
argv_array_push(out, "GIT_DIR=.git");
1336+
argv_array_pushf(out, "%s=%s", GIT_DIR_ENVIRONMENT,
1337+
DEFAULT_GIT_DIR_ENVIRONMENT);
13371338
}

0 commit comments

Comments
 (0)