Skip to content

Commit e998041

Browse files
megabreitgitster
authored andcommitted
t0008: 4 tests fail with ksh88
In t0008, we have cat <<-EOF ... a/b/.gitignore:8:!on* "a/b/one\"three" ... EOF and expect that the backslash-dq is passed through literally. ksh88 eats the backslash and produces a wrong expect file to compare the actual output with. Using \\" works this around without breaking other POSIX shells (which collapse backslash-backslash to a single backslash), and ksh88 does so, too. It makes it easier to read, too, because the reason why we are writing backslash there is *not* because we think dq is special and want to quote it (if that were the case we would have two more backslashes on that line). It is simply because we want a single literal backslash there. Since backslash is treated specially in unquoted here-document, explicitly doubling it to quote it expresses our intent better than relying on the character that immediately comes after it (i.e. '"') not being a special character. Signed-off-by: Armin Kunaschik <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4b589e5 commit e998041

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t0008-ignores.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ cat <<-EOF >expected-verbose
605605
a/b/.gitignore:8:!on* a/b/one
606606
a/b/.gitignore:8:!on* a/b/one one
607607
a/b/.gitignore:8:!on* a/b/one two
608-
a/b/.gitignore:8:!on* "a/b/one\"three"
608+
a/b/.gitignore:8:!on* "a/b/one\\"three"
609609
a/b/.gitignore:9:!two a/b/two
610610
a/.gitignore:1:two* a/b/twooo
611611
$global_excludes:2:!globaltwo globaltwo
@@ -686,7 +686,7 @@ cat <<-EOF >expected-all
686686
a/b/.gitignore:8:!on* b/one
687687
a/b/.gitignore:8:!on* b/one one
688688
a/b/.gitignore:8:!on* b/one two
689-
a/b/.gitignore:8:!on* "b/one\"three"
689+
a/b/.gitignore:8:!on* "b/one\\"three"
690690
a/b/.gitignore:9:!two b/two
691691
:: b/not-ignored
692692
a/.gitignore:1:two* b/twooo

0 commit comments

Comments
 (0)