]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule: refrain from filtering GIT_CONFIG_COUNT
authorJonathan Tan <jonathantanmy@google.com>
Thu, 17 Jun 2021 17:13:24 +0000 (10:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Jun 2021 16:57:54 +0000 (09:57 -0700)
14111fc492 ("git: submodule honor -c credential.* from command line",
2016-03-01) taught Git to pass through the GIT_CONFIG_PARAMETERS
environment variable when invoking a subprocess on behalf of a
submodule. But when d8d77153ea ("config: allow specifying config entries
via envvar pairs", 2021-01-15) introduced support for GIT_CONFIG_COUNT
(and its associated GIT_CONFIG_KEY_? and GIT_CONFIG_VALUE_?), the
subprocess mechanism wasn't updated to also pass through these
variables.

Since they are conceptually the same (d8d77153ea was written to address
a shortcoming of GIT_CONFIG_PARAMETERS), update the submodule subprocess
mechanism to also pass through GIT_CONFIG_COUNT.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c

index 0b1d9c1dde5a8fc5cec04f13241f94b8a4378d5f..f09031e39769b252823e135df3aa2255bf5ae1cc 100644 (file)
@@ -489,7 +489,8 @@ static void prepare_submodule_repo_env_no_git_dir(struct strvec *out)
        const char * const *var;
 
        for (var = local_repo_env; *var; var++) {
-               if (strcmp(*var, CONFIG_DATA_ENVIRONMENT))
+               if (strcmp(*var, CONFIG_DATA_ENVIRONMENT) &&
+                   strcmp(*var, CONFIG_COUNT_ENVIRONMENT))
                        strvec_push(out, *var);
        }
 }