Skip to content

Commit

Permalink
t0300: use write_script helper
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Feb 4, 2012
1 parent 840c519 commit 3d9f5b6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions t/t0300-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@ test_expect_success 'setup helper scripts' '
done
EOF
cat >git-credential-useless <<-\EOF &&
#!/bin/sh
write_script git-credential-useless <<-\EOF &&
. ./dump
exit 0
EOF
chmod +x git-credential-useless &&
cat >git-credential-verbatim <<-\EOF &&
#!/bin/sh
write_script git-credential-verbatim <<-\EOF &&
user=$1; shift
pass=$1; shift
. ./dump
test -z "$user" || echo username=$user
test -z "$pass" || echo password=$pass
EOF
chmod +x git-credential-verbatim &&
PATH="$PWD:$PATH"
'
Expand Down

0 comments on commit 3d9f5b6

Please sign in to comment.