Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koutcher <thomas.koutcher@online.fr>2020-10-16 00:59:20 +0300
committerJunio C Hamano <gitster@pobox.com>2020-10-16 22:30:45 +0300
commit567ad2c0f90fe63d1fde2c0269be8df17675148c (patch)
treeeb429e885577246e40e8bfa459e7ce58da5355c0 /t/t0300-credentials.sh
parenta5fa49ff0a8f3252c6bff49f92b85e7683868f8a (diff)
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/t0300-credentials.sh')
-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 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