Skip to content

Commit 3d9f5b6

Browse files
peffgitster
authored andcommitted
t0300: use write_script helper
t0300 creates some helper shell scripts, and marks them with "!/bin/sh". Even though the scripts are fairly simple, they can fail on broken shells (specifically, Solaris /bin/sh will persist a temporary assignment to IFS in a "read" command). Rather than work around the problem for Solaris /bin/sh, using write_script will make sure we point to a known-good shell that the user has given us. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 840c519 commit 3d9f5b6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

t/t0300-credentials.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff 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
'

0 commit comments

Comments
 (0)