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' '
14
14
done
15
15
EOF
16
16
17
- cat >git-credential-useless <<-\EOF &&
18
- #!/bin/sh
17
+ write_script git-credential-useless <<-\EOF &&
19
18
. ./dump
20
19
exit 0
21
20
EOF
22
- chmod +x git-credential-useless &&
23
21
24
- cat >git-credential-verbatim <<-\EOF &&
25
- #!/bin/sh
22
+ write_script git-credential-verbatim <<-\EOF &&
26
23
user=$1; shift
27
24
pass=$1; shift
28
25
. ./dump
29
26
test -z "$user" || echo username=$user
30
27
test -z "$pass" || echo password=$pass
31
28
EOF
32
- chmod +x git-credential-verbatim &&
33
29
34
30
PATH="$PWD:$PATH"
35
31
'
Original file line number Diff line number Diff line change @@ -395,11 +395,20 @@ test_config () {
395
395
git config " $@ "
396
396
}
397
397
398
+
398
399
test_config_global () {
399
400
test_when_finished " test_unconfig --global '$1 '" &&
400
401
git config --global " $@ "
401
402
}
402
403
404
+ write_script () {
405
+ {
406
+ echo " #!${2-" $SHELL_PATH " } " &&
407
+ cat
408
+ } > " $1 " &&
409
+ chmod +x " $1 "
410
+ }
411
+
403
412
# Use test_set_prereq to tell that a particular prerequisite is available.
404
413
# The prerequisite can later be checked for in two ways:
405
414
#
You can’t perform that action at this time.
0 commit comments