Merge branch 'bc/zsh-compatibility'

zsh can pretend to be a normal shell pretty well except for some
glitches that we tickle in some of our scripts. Work them around
so that "vimdiff" and our test suite works well enough with it.

* bc/zsh-compatibility:
  vimdiff: make script and tests work with zsh
  t4046: avoid continue in &&-chain for zsh
This commit is contained in:
Junio C Hamano 2024-05-08 10:18:46 -07:00
commit c2b36ab32e
2 changed files with 10 additions and 9 deletions

View file

@ -72,7 +72,6 @@ gen_cmd_aux () {
nested=0 nested=0
nested_min=100 nested_min=100
# Step 1: # Step 1:
# #
# Increase/decrease "start"/"end" indices respectively to get rid of # Increase/decrease "start"/"end" indices respectively to get rid of
@ -87,7 +86,7 @@ gen_cmd_aux () {
IFS=# IFS=#
for c in $(echo "$LAYOUT" | sed 's:.:&#:g') for c in $(echo "$LAYOUT" | sed 's:.:&#:g')
do do
if test "$c" = " " if test -z "$c" || test "$c" = " "
then then
continue continue
fi fi

View file

@ -20,13 +20,15 @@ test_expect_success setup '
for t in o x for t in o x
do do
path="$b$o$t" && path="$b$o$t" &&
case "$path" in ooo) continue ;; esac && if test "$path" != ooo
paths="$paths$path " && then
p=" $path" && paths="$paths$path " &&
case "$b" in x) echo "$m1$p" ;; esac && p=" $path" &&
case "$o" in x) echo "$m2$p" ;; esac && case "$b" in x) echo "$m1$p" ;; esac &&
case "$t" in x) echo "$m3$p" ;; esac || case "$o" in x) echo "$m2$p" ;; esac &&
return 1 case "$t" in x) echo "$m3$p" ;; esac ||
return 1
fi
done done
done done
done >ls-files-s.expect && done >ls-files-s.expect &&