Skip to content

Commit 97c1364

Browse files
committed
t0008: do not depend on 'echo' handling backslashes specially
The original used to pass with /bin/dash but not with /bin/bash set to $SHELL_PATH. The former turns "\\" into "\", but the latter does not. Signed-off-by: Junio C Hamano <[email protected]>
1 parent e61a6c1 commit 97c1364

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

t/t0008-ignores.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -816,12 +816,14 @@ test_expect_success NOT_MINGW,NOT_CYGWIN 'correct handling of backslashes' '
816816
>"whitespace/trailing 5 \\ \\ " &&
817817
>"whitespace/trailing 6 \\a\\" &&
818818
>whitespace/untracked &&
819-
echo "whitespace/trailing 1 \\ " >ignore &&
820-
echo "whitespace/trailing 2 \\\\\\\\\\\\\\\\" >>ignore &&
821-
echo "whitespace/trailing 3 \\\\\\\\\\\\\\\\ " >>ignore &&
822-
echo "whitespace/trailing 4 \\\\\\\\\\\\ " >>ignore &&
823-
echo "whitespace/trailing 5 \\\\\\\\ \\\\\\\\\\\\ " >>ignore &&
824-
echo "whitespace/trailing 6 \\\\\\\\a\\\\\\\\" >>ignore &&
819+
sed -e "s/Z$//" >ignore <<-\EOF &&
820+
whitespace/trailing 1 \ Z
821+
whitespace/trailing 2 \\\\Z
822+
whitespace/trailing 3 \\\\ Z
823+
whitespace/trailing 4 \\\ Z
824+
whitespace/trailing 5 \\ \\\ Z
825+
whitespace/trailing 6 \\a\\Z
826+
EOF
825827
echo whitespace/untracked >expect &&
826828
>err.expect &&
827829
git ls-files -o -X ignore whitespace >actual 2>err &&

0 commit comments

Comments
 (0)