diff options
author | Jeff King <peff@peff.net> | 2016-04-28 15:37:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-28 19:47:34 +0200 |
commit | 860cba61a3eac38151fd203547df7515023303e9 (patch) | |
tree | a9d1429faa3e6485406ff08d7ea76344feaa5a89 /t/t5550-http-fetch-dumb.sh | |
parent | t5550: break submodule config test into multiple sub-tests (diff) | |
download | git-860cba61a3eac38151fd203547df7515023303e9.tar.xz git-860cba61a3eac38151fd203547df7515023303e9.zip |
submodule: export sanitized GIT_CONFIG_PARAMETERS
Commit 14111fc (git: submodule honor -c credential.* from
command line, 2016-02-29) taught git-submodule.sh to save
the sanitized value of $GIT_CONFIG_PARAMETERS when clearing
the environment for a submodule. However, it failed to
export the result, meaning that it had no effect for any
sub-programs.
We didn't catch this in our initial tests because we checked
only the "clone" case, which does not go through the shell
script at all. Provoking "git submodule update" to do a
fetch demonstrates the bug.
Noticed-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5550-http-fetch-dumb.sh')
-rwxr-xr-x | t/t5550-http-fetch-dumb.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index e8e91bbb6d..13ac788fde 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -112,6 +112,23 @@ test_expect_success 'cmdline credential config passes to submodule via clone' ' expect_askpass pass user@host ' +test_expect_success 'cmdline credential config passes submodule update' ' + # advance the submodule HEAD so that a fetch is required + git commit --allow-empty -m foo && + git push "$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/repo.git" HEAD && + sha1=$(git rev-parse HEAD) && + git -C super-clone update-index --cacheinfo 160000,$sha1,sub && + + set_askpass wrong pass@host && + test_must_fail git -C super-clone submodule update && + + set_askpass wrong pass@host && + git -C super-clone \ + -c "credential.$HTTPD_URL.username=user@host" \ + submodule update && + expect_askpass pass user@host +' + test_expect_success 'fetch changes via http' ' echo content >>file && git commit -a -m two && |