Re: [PATCH] t0300-credentials: Word around a solaris /bin/sh bug
From: Frans Klaver <hidden>
Date: 2016-06-15 22:52:55
Wor_k_ around ... On Thu, 02 Feb 2012 20:32:15 +0100, Ben Walton [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Solaris' /bin/sh was making the IFS setting permanent instead of temporary when using it to slurp in credentials in the generated 'dump' script of the 'setup helper scripts' test in t0300-credentials. The stderr file that was being compared to expected-stderr contained the following stray line from the credential helper run: warning: invalid credential line: username foo To avoid this bug, capture the original IFS and force it to be reset after its use is no longer required. For now, this is lighter weight than altering which shell these scripts use as their shebang. Signed-off-by: Ben Walton <redacted> --- t/t0300-credentials.sh | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh index 885af8f..1be3fe2 100755 --- a/t/t0300-credentials.sh +++ b/t/t0300-credentials.sh@@ -8,10 +8,12 @@ test_expect_success 'setup helper scripts' ' cat >dump <<-\EOF && whoami=`echo $0 | sed s/.*git-credential-//` echo >&2 "$whoami: $*" + OIFS=$IFS while IFS== read key value; do echo >&2 "$whoami: $key=$value" eval "$key=$value" done + IFS=$OIFS EOFcat >git-credential-useless <<-\EOF &&
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/