diff options
author | Thomas Koutcher <thomas.koutcher@online.fr> | 2020-10-15 21:59:20 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-16 12:30:45 -0700 |
commit | 567ad2c0f90fe63d1fde2c0269be8df17675148c (patch) | |
tree | eb429e885577246e40e8bfa459e7ce58da5355c0 /t | |
parent | Git 2.29-rc2 (diff) | |
download | tgif-567ad2c0f90fe63d1fde2c0269be8df17675148c.tar.xz |
credential: load default config
Make `git credential fill` honour the core.askPass variable.
Signed-off-by: Thomas Koutcher <thomas.koutcher@online.fr>
[jk: added test]
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t0300-credentials.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh index bc2d74098f..a18f8a473b 100755 --- a/t/t0300-credentials.sh +++ b/t/t0300-credentials.sh @@ -265,6 +265,32 @@ test_expect_success 'internal getpass does not ask for known username' ' EOF ' +test_expect_success 'git-credential respects core.askPass' ' + write_script alternate-askpass <<-\EOF && + echo >&2 "alternate askpass invoked" + echo alternate-value + EOF + test_config core.askpass "$PWD/alternate-askpass" && + ( + # unset GIT_ASKPASS set by lib-credential.sh which would + # override our config, but do so in a subshell so that we do + # not interfere with other tests + sane_unset GIT_ASKPASS && + check fill <<-\EOF + protocol=http + host=example.com + -- + protocol=http + host=example.com + username=alternate-value + password=alternate-value + -- + alternate askpass invoked + alternate askpass invoked + EOF + ) +' + HELPER="!f() { cat >/dev/null echo username=foo |