]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule.c: use GIT_DIR_ENVIRONMENT consistently
authorStefan Beller <sbeller@google.com>
Tue, 3 Jan 2017 18:30:47 +0000 (10:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 7 Jan 2017 21:10:02 +0000 (13:10 -0800)
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>
submodule.c

index ece17315d671cf182f21c261d879c58f193cde09..fa32f450331a8ac7ab0bc7eb8008cf00427a1f73 100644 (file)
@@ -1333,5 +1333,6 @@ void prepare_submodule_repo_env(struct argv_array *out)
                if (strcmp(*var, CONFIG_DATA_ENVIRONMENT))
                        argv_array_push(out, *var);
        }
-       argv_array_push(out, "GIT_DIR=.git");
+       argv_array_pushf(out, "%s=%s", GIT_DIR_ENVIRONMENT,
+                        DEFAULT_GIT_DIR_ENVIRONMENT);
 }