(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: { (SQ <'Pathnames with funny characters.\n'> <'\n'> <'This test tries pathnames with funny characters in the working\n'> <'tree, index, and tree objects.\n'> ) } spids: [21] ) ] spids: [21] ) (C {(.)} {(./test-lib.sh)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:HT spids:[35]) op: Equal rhs: {(SQ <'\t'>)} spids: [35] ) ] spids: [35] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(test_have_prereq)} {(MINGW)}) (command.SimpleCommand words: [{(echo)}] redirects: [ (redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)}) (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ('Name with an') (${ VSub_Name HT) (HT))} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test)} {(-f)} {(DQ ('Name with an') (${ VSub_Name HT) (HT))})] negated: T ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all spids:[85]) op: Equal rhs: {(SQ <'Your filesystem does not allow tabs in filenames'>)} spids: [85] ) ] spids: [85] ) (C {(test_done)}) ] spids: [16777215 78] ) ] spids: [16777215 93] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:p0 spids:[96]) op: Equal rhs: {(SQ <no-funny>)} spids: [96] ) ] spids: [96] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:p1 spids:[101]) op: Equal rhs: {(SQ <'tabs\t," (dq) and spaces'>)} spids: [101] ) ] spids: [101] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:p2 spids:[106]) op: Equal rhs: {(SQ <'just space'>)} spids: [106] ) ] spids: [106] ) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\tcat >"$p0" <<-\\EOF &&\n'> <'\t1. A quick brown fox jumps over the lazy cat, oops dog.\n'> <'\t2. A quick brown fox jumps over the lazy cat, oops dog.\n'> <'\t3. A quick brown fox jumps over the lazy cat, oops dog.\n'> <'\tEOF\n'> <'\n'> <'\t{ cat "$p0" >"$p1" || :; } &&\n'> <'\t{ echo "Foo Bar Baz" >"$p2" || :; }\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup: populate index and tree'>)} {(SQ <'\n'> <'\tgit update-index --add "$p0" "$p2" &&\n'> <'\tt0=$(git write-tree)\n'>)} ) (C {(test_expect_success)} {(SQ <'ls-files prints space in filename verbatim'>)} { (SQ <'\n'> <'\tprintf "%s\\n" "just space" no-funny >expected &&\n'> <'\tgit ls-files >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup: add funny filename'>)} {(SQ <'\n'> <'\tgit update-index --add "$p1" &&\n'> <'\tt1=$(git write-tree)\n'>)} ) (C {(test_expect_success)} {(SQ <'ls-files quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tjust space\n'> <'\tno-funny\n'> <'\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit ls-files >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'ls-files -z does not quote funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tjust space\n'> <'\tno-funny\n'> <'\ttabs\t," (dq) and spaces\n'> <'\tEOF\n'> <'\tgit ls-files -z >ls-files.z &&\n'> <'\tperl -pe "y/\\000/\\012/" <ls-files.z >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'ls-tree quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tjust space\n'> <'\tno-funny\n'> <'\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit ls-tree -r $t1 >ls-tree &&\n'> <'\tsed -e "s/^[^\t]*\t//" <ls-tree >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-index --name-status quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tA\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index --name-status $t0 >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-tree --name-status quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tA\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-tree --name-status $t0 $t1 >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-index -z does not quote funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tA\n'> <'\ttabs\t," (dq) and spaces\n'> <'\tEOF\n'> <'\tgit diff-index -z --name-status $t0 >diff-index.z &&\n'> <'\tperl -pe "y/\\000/\\012/" <diff-index.z >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-tree -z does not quote funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tA\n'> <'\ttabs\t," (dq) and spaces\n'> <'\tEOF\n'> <'\tgit diff-tree -z --name-status $t0 $t1 >diff-tree.z &&\n'> <'\tperl -pe y/\\\\000/\\\\012/ <diff-tree.z >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-tree --find-copies-harder quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tCNUM\tno-funny\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-tree -C --find-copies-harder --name-status $t0 $t1 >out &&\n'> <'\tsed -e "s/^C[0-9]*/CNUM/" <out >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup: remove unfunny index entry'>)} {(SQ <'\n'> <'\tgit update-index --force-remove "$p0"\n'>)} ) (C {(test_expect_success)} {(SQ <'diff-tree -M quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tRNUM\tno-funny\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -M --name-status $t0 >out &&\n'> <'\tsed -e "s/^R[0-9]*/RNUM/" <out >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff-index -M -p quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tdiff --git a/no-funny "b/tabs\\t,\\" (dq) and spaces"\n'> <'\tsimilarity index NUM%\n'> <'\trename from no-funny\n'> <'\trename to "tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -M -p $t0 >diff &&\n'> <'\tsed -e "s/index [0-9]*%/index NUM%/" <diff >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup: mode change'>)} {(SQ <'\n'> <'\tchmod +x "$p1"\n'>)}) (C {(test_expect_success)} {(SQ <'diff-index -M -p with mode change quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\tdiff --git a/no-funny "b/tabs\\t,\\" (dq) and spaces"\n'> <'\told mode 100644\n'> <'\tnew mode 100755\n'> <'\tsimilarity index NUM%\n'> <'\trename from no-funny\n'> <'\trename to "tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -M -p $t0 >diff &&\n'> <'\tsed -e "s/index [0-9]*%/index NUM%/" <diff >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'diffstat for rename quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t "tabs\\t,\\" (dq) and spaces"\n'> <'\t 1 file changed, 0 insertions(+), 0 deletions(-)\n'> <'\tEOF\n'> <'\tgit diff-index -M -p $t0 >diff &&\n'> <'\tgit apply --stat <diff >diffstat &&\n'> <'\tsed -e "s/|.*//" -e "s/ *\\$//" <diffstat >current &&\n'> <'\ttest_i18ncmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'numstat for rename quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t0\t0\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -M -p $t0 >diff &&\n'> <'\tgit apply --numstat <diff >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'numstat without -M quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t0\t3\tno-funny\n'> <'\t3\t0\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -p $t0 >diff &&\n'> <'\tgit apply --numstat <diff >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'numstat for non-git rename diff quotes funny filename'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t0\t3\tno-funny\n'> <'\t3\t0\t"tabs\\t,\\" (dq) and spaces"\n'> <'\tEOF\n'> <'\tgit diff-index -p $t0 >git-diff &&\n'> <'\tsed -ne "/^[-+@]/p" <git-diff >diff &&\n'> <'\tgit apply --numstat <diff >current &&\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_done)}) ] )