t: fix quotes tests for --pathspec-from-file
While working on the next patch, I also noticed that quotes testing via `"\"file\\101.t\""` was somewhat incorrect: I escaped `\` one time while I had to escape it two times! Tests still worked due to `"` being preserved which in turn prevented pathspec from matching files. Fix this by using here-doc instead. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d0654dc308
commit
568cabb2fe
@ -100,7 +100,11 @@ test_expect_success 'CRLF delimiters' '
|
||||
test_expect_success 'quotes' '
|
||||
restore_checkpoint &&
|
||||
|
||||
printf "\"file\\101.t\"" | git commit --pathspec-from-file=- -m "Commit" &&
|
||||
cat >list <<-\EOF &&
|
||||
"file\101.t"
|
||||
EOF
|
||||
|
||||
git commit --pathspec-from-file=list -m "Commit" &&
|
||||
|
||||
cat >expect <<-\EOF &&
|
||||
A fileA.t
|
||||
@ -111,7 +115,10 @@ test_expect_success 'quotes' '
|
||||
test_expect_success 'quotes not compatible with --pathspec-file-nul' '
|
||||
restore_checkpoint &&
|
||||
|
||||
printf "\"file\\101.t\"" >list &&
|
||||
cat >list <<-\EOF &&
|
||||
"file\101.t"
|
||||
EOF
|
||||
|
||||
test_must_fail git commit --pathspec-from-file=list --pathspec-file-nul -m "Commit"
|
||||
'
|
||||
|
||||
|
Reference in New Issue
Block a user