remote.c: hoist read_config into remote_get_1
[gitweb.git] / t / t0300-credentials.sh
index 538ea5fb1c27bf5e4f9c4a0268f219f5d6d6e9c5..d7ef44b4a261a588874df3b8359d809655286a43 100755 (executable)
@@ -6,7 +6,7 @@ test_description='basic credential helper tests'
 
 test_expect_success 'setup helper scripts' '
        cat >dump <<-\EOF &&
-       whoami=`echo $0 | sed s/.*git-credential-//`
+       whoami=$(echo $0 | sed s/.*git-credential-//)
        echo >&2 "$whoami: $*"
        OIFS=$IFS
        IFS==
@@ -289,4 +289,13 @@ test_expect_success 'http paths can be part of context' '
        EOF
 '
 
+test_expect_success 'helpers can abort the process' '
+       test_must_fail git \
+               -c credential.helper="!f() { echo quit=1; }; f" \
+               -c credential.helper="verbatim foo bar" \
+               credential fill >stdout &&
+       >expect &&
+       test_cmp expect stdout
+'
+
 test_done