git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t0300-credentials: Word around a solaris /bin/sh bug
@ 2012-02-02 19:32 Ben Walton
  2012-02-02 19:44 ` Frans Klaver
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Ben Walton @ 2012-02-02 19:32 UTC (permalink / raw)
  To: git, gitster; +Cc: Ben Walton

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 <bwalton@artsci.utoronto.ca>
---
 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
 	EOF
 
 	cat >git-credential-useless <<-\EOF &&
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-02-04  7:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 19:32 [PATCH] t0300-credentials: Word around a solaris /bin/sh bug Ben Walton
2012-02-02 19:44 ` Frans Klaver
2012-02-02 19:48   ` Ben Walton
2012-02-02 20:02 ` Jeff King
2012-02-03  1:02   ` Junio C Hamano
2012-02-03 12:06     ` Jeff King
2012-02-03 13:45       ` Ben Walton
2012-02-03 20:32       ` Junio C Hamano
2012-02-03 21:26         ` Jeff King
2012-02-03 21:50           ` Junio C Hamano
2012-02-03 21:55             ` Jeff King
2012-02-03 22:00               ` Ben Walton
2012-02-03 22:45               ` Junio C Hamano
2012-02-03 23:27                 ` Jeff King
2012-02-04  6:27                 ` Jeff King
2012-02-04  6:29                   ` [PATCH 1/2] tests: add write_script helper function Jeff King
2012-02-04  6:30                   ` [PATCH 2/2] t0300: use write_script helper Jeff King
2012-02-04  6:58                     ` Junio C Hamano
2012-02-04  7:00                       ` Jeff King
2012-02-02 20:16 ` [PATCH] t0300-credentials: Word around a solaris /bin/sh bug Jonathan Nieder
2012-02-02 20:43   ` Matthieu Moy
2012-02-02 21:11     ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).