diff options
author | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | 2019-12-31 10:15:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-15 12:14:20 -0800 |
commit | 568cabb2fed8e5e61057ac678a70a565dffd0763 (patch) | |
tree | 5ae4d2967f70ac05d15fe6c5db1e0dc2cff09472 /t/t3704-add-pathspec-file.sh | |
parent | Git 2.25 (diff) | |
download | tgif-568cabb2fed8e5e61057ac678a70a565dffd0763.tar.xz |
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>
Diffstat (limited to 't/t3704-add-pathspec-file.sh')
-rwxr-xr-x | t/t3704-add-pathspec-file.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/t/t3704-add-pathspec-file.sh b/t/t3704-add-pathspec-file.sh index 3cfdb669b7..61b6e51009 100755 --- a/t/t3704-add-pathspec-file.sh +++ b/t/t3704-add-pathspec-file.sh @@ -97,7 +97,11 @@ test_expect_success 'CRLF delimiters' ' test_expect_success 'quotes' ' restore_checkpoint && - printf "\"file\\101.t\"" | git add --pathspec-from-file=- && + cat >list <<-\EOF && + "file\101.t" + EOF + + git add --pathspec-from-file=list && cat >expect <<-\EOF && A fileA.t @@ -108,7 +112,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 add --pathspec-from-file=list --pathspec-file-nul ' |