]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/submodule--helper.c
git: submodule honor -c credential.* from command line
authorJacob Keller <jacob.keller@gmail.com>
Mon, 29 Feb 2016 22:58:35 +0000 (14:58 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Mar 2016 20:24:22 +0000 (12:24 -0800)
commit14111fc49272a70ceaeb5039796fbceb8a6e1cb7
tree8f4a8499b97577d61dac31de1baca228a05915e4
parente70986d72515b7601aea7d8d86a9d3bed53866f3
git: submodule honor -c credential.* from command line

Due to the way that the git-submodule code works, it clears all local
git environment variables before entering submodules. This is normally
a good thing since we want to clear settings such as GIT_WORKTREE and
other variables which would affect the operation of submodule commands.
However, GIT_CONFIG_PARAMETERS is special, and we actually do want to
preserve these settings. However, we do not want to preserve all
configuration as many things should be left specific to the parent
project.

Add a git submodule--helper function, sanitize-config, which shall be
used to sanitize GIT_CONFIG_PARAMETERS, removing all key/value pairs
except a small subset that are known to be safe and necessary.

Replace all the calls to clear_local_git_env with a wrapped function
that filters GIT_CONFIG_PARAMETERS using the new helper and then
restores it to the filtered subset after clearing the rest of the
environment.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
git-submodule.sh
t/t5550-http-fetch-dumb.sh
t/t7412-submodule--helper.sh [new file with mode: 0755]