File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,18 @@ test_expect_success 'setup helper scripts' '
1414 done
1515 EOF
1616
17- cat >git-credential-useless <<-\EOF &&
18- #!/bin/sh
17+ write_script git-credential-useless <<-\EOF &&
1918 . ./dump
2019 exit 0
2120 EOF
22- chmod +x git-credential-useless &&
2321
24- cat >git-credential-verbatim <<-\EOF &&
25- #!/bin/sh
22+ write_script git-credential-verbatim <<-\EOF &&
2623 user=$1; shift
2724 pass=$1; shift
2825 . ./dump
2926 test -z "$user" || echo username=$user
3027 test -z "$pass" || echo password=$pass
3128 EOF
32- chmod +x git-credential-verbatim &&
3329
3430 PATH="$PWD:$PATH"
3531'
Original file line number Diff line number Diff line change @@ -395,11 +395,20 @@ test_config () {
395395 git config " $@ "
396396}
397397
398+
398399test_config_global () {
399400 test_when_finished " test_unconfig --global '$1 '" &&
400401 git config --global " $@ "
401402}
402403
404+ write_script () {
405+ {
406+ echo " #!${2-" $SHELL_PATH " } " &&
407+ cat
408+ } > " $1 " &&
409+ chmod +x " $1 "
410+ }
411+
403412# Use test_set_prereq to tell that a particular prerequisite is available.
404413# The prerequisite can later be checked for in two ways:
405414#
You can’t perform that action at this time.
0 commit comments