summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorThomas Koutcher <thomas.koutcher@online.fr>2020-10-15 21:59:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-16 19:30:45 (GMT)
commit567ad2c0f90fe63d1fde2c0269be8df17675148c (patch)
treeeb429e885577246e40e8bfa459e7ce58da5355c0 /t
parenta5fa49ff0a8f3252c6bff49f92b85e7683868f8a (diff)
downloadgit-567ad2c0f90fe63d1fde2c0269be8df17675148c.zip
git-567ad2c0f90fe63d1fde2c0269be8df17675148c.tar.gz
git-567ad2c0f90fe63d1fde2c0269be8df17675148c.tar.bz2
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-xt/t0300-credentials.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index bc2d740..a18f8a4 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