Skip to content

Fix broken test with zsh as /bin/sh

brian m. carlson git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1t9001: avoid including non-trailing NUL bytes in variablest/t9001-send-email.sh+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] Fix broken test with zsh as /bin/sh

macOS Catalina provides zsh as one of the three options for /bin/sh (the other two being bash and dash). Therefore, it's possible that people will use zsh as /bin/sh and expect it to work when running Git and the testsuite.

There are two things required for this to happen. One is a patch to zsh to make it run all items in a pipeline in a subshell in sh mode, just as POSIX requires. I've sent a patch[0] upstream to make that happen; without that patch, multiple tests fail.

The other is this patch, which addresses a difference in behavior between bash and dash, which strip out NUL bytes from the output of a command substitution, and zsh, which does not. Both behaviors are permitted by POSIX, so this patch makes the test work in either case.

[0] https://www.zsh.org/mla/workers/2019/msg00960.html

brian m. carlson (1):
t9001: avoid including non-trailing NUL bytes in variables

 t/t9001-send-email.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)