git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] perf: fix test_export with SHELL=zsh
@ 2021-10-02  9:40 René Scharfe
  2021-10-02 11:26 ` Johannes Altmanninger
  2021-10-02 21:02 ` [PATCH] perf: fix test_export with SHELL=zsh brian m. carlson
  0 siblings, 2 replies; 7+ messages in thread
From: René Scharfe @ 2021-10-02  9:40 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

Unlike other shells, zsh doesn't do word-splitting on variables.  This
is documented in https://zsh.sourceforge.io/FAQ/zshfaq03.html#31.  That
breaks the perf function test_export because it uses a space-separated
variable as a poor man's array, and as a consequence p0000 fails with
"not ok 3 - test_export works".  Pass the value through an unquoted
command substitution to force word-splitting even in zsh.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 t/perf/perf-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index f5ed092ee5..f74cfd35d6 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -165,7 +165,7 @@ test_export () {
 '"$1"'
 ret=$?
 needles=
-for v in $test_export_
+for v in $(echo "$test_export_")
 do
 	needles="$needles;s/^$v=/export $v=/p"
 done
--
2.33.0

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

end of thread, other threads:[~2021-10-08  5:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-02  9:40 [PATCH] perf: fix test_export with SHELL=zsh René Scharfe
2021-10-02 11:26 ` Johannes Altmanninger
2021-10-07 18:47   ` [PATCH] t/perf: do not run tests in user's $SHELL Johannes Altmanninger
2021-10-08  3:07     ` Jeff King
2021-10-08  5:34       ` Johannes Altmanninger
2021-10-08  5:41         ` Jeff King
2021-10-02 21:02 ` [PATCH] perf: fix test_export with SHELL=zsh brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).