(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {<check-ignore>} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: init_vars body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:global_excludes) op: assign_op.Equal rhs: {(DQ <global-excludes>)} spids: [21] ) ] ) ] ) ) (command.ShFunction name: enable_global_excludes body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<init_vars>}) (C {<git>} {<config>} {<core.excludesfile>} {(DQ ($ Id.VSub_DollarName '$global_excludes'))} ) ] ) ] ) ) (command.ShFunction name: expect_in body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dest) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$HOME') <'/expected-'> ($ Id.VSub_Number '$1'))} spids: [63] ) (assign_pair lhs: (sh_lhs_expr.Name name:text) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$2'))} spids: [70] ) ] ) (command.If arms: [ (if_arm cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$text'))})] action: [ (command.Simple redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$dest'))} ) ] do_fork: F ) ] spids: [76 87] ) ] else_action: [ (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$text'))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$dest'))} ) ] do_fork: T ) ] ) ] ) ) (command.ShFunction name: expect body: (BraceGroup children:[(C {<expect_in>} {<stdout>} {(DQ ($ Id.VSub_Number '$1'))})]) ) (command.ShFunction name: expect_from_stdin body: (BraceGroup children: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$HOME') <'/expected-stdout'>)} ) ] do_fork: T ) ] ) ) (command.ShFunction name: test_stderr body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [165] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<expect_in>} {<stderr>} {(DQ ($ Id.VSub_Number '$1'))}) (C {<test_i18ncmp>} {(DQ ($ Id.VSub_DollarName '$HOME') <'/expected-stderr'>)} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stderr'>)} ) ] ) ] ) ) (command.ShFunction name: broken_c_unquote body: (BraceGroup children: [ (C {(DQ ($ Id.VSub_DollarName '$PERL_PATH'))} {<-pe>} {(SQ <'s/^"//; s/\\\\//; s/"$//; tr/\\n/\\0/'>)} {(DQ ($ Id.VSub_At '$@'))} ) ] ) ) (command.ShFunction name: broken_c_unquote_verbose body: (BraceGroup children: [ (C {(DQ ($ Id.VSub_DollarName '$PERL_PATH'))} {<-pe>} {(SQ <'s/\t"/\t/; s/\\\\//; s/"$//; tr/:\\t\\n/\\0/'>)} {(DQ ($ Id.VSub_At '$@'))} ) ] ) ) (command.ShFunction name: stderr_contains body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:regexp) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [255] ) ] ) (command.If arms: [ (if_arm cond: [ (C {<test_i18ngrep>} {(DQ ($ Id.VSub_DollarName '$regexp'))} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stderr'>)} ) ] action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})] spids: [261 275] ) ] else_action: [ (C {<echo>} { (DQ <'didn\'t find /'> ($ Id.VSub_DollarName '$regexp') <'/ in '> ($ Id.VSub_DollarName '$HOME') <'/stderr'> ) } ) (C {<cat>} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stderr'>)}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] ) ] ) ) (command.ShFunction name: stderr_empty_on_success body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect_code) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [323] ) ] ) (command.If arms: [ (if_arm cond: [ (C {<test>} {($ Id.VSub_DollarName '$expect_code')} {<Id.Lit_Equals '='>} {<0>}) ] action: [(C {<test_stderr>} {(DQ )})] spids: [329 340] ) ] else_action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})] ) ] ) ) (command.ShFunction name: test_check_ignore body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:args) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [378] ) (assign_pair lhs: (sh_lhs_expr.Name name:expect_code) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Number 2> suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{<0>}) ) ) } spids: [383] ) (assign_pair lhs: (sh_lhs_expr.Name name:global_args) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$3'))} spids: [392] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp] children: [ (C {<init_vars>}) (C {<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stdout'>)} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stderr'>)} {(DQ ($ Id.VSub_DollarName '$HOME') <'/cmd'>)} ) (command.Simple words: [ {<echo>} {<git>} {($ Id.VSub_DollarName '$global_args')} {<check-ignore>} {($ Id.VSub_DollarName '$quiet_opt')} {($ Id.VSub_DollarName '$verbose_opt')} {($ Id.VSub_DollarName '$non_matching_opt')} {($ Id.VSub_DollarName '$no_index_opt')} {($ Id.VSub_DollarName '$args')} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$HOME') <'/cmd'>)} ) ] do_fork: T ) (command.Simple words: [{<echo>} {(DQ ($ Id.VSub_DollarName '$expect_code'))}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$HOME') <'/expected-exit-code'>)} ) ] do_fork: T ) (command.Simple words: [ {<test_expect_code>} {(DQ ($ Id.VSub_DollarName '$expect_code'))} {<git>} {($ Id.VSub_DollarName '$global_args')} {<check-ignore>} {($ Id.VSub_DollarName '$quiet_opt')} {($ Id.VSub_DollarName '$verbose_opt')} {($ Id.VSub_DollarName '$non_matching_opt')} {($ Id.VSub_DollarName '$no_index_opt')} {($ Id.VSub_DollarName '$args')} ] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$HOME') <'/stdout'>)} ) (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {(DQ ($ Id.VSub_DollarName '$HOME') <'/stderr'>)} ) ] do_fork: T ) (C {<test_cmp>} {(DQ ($ Id.VSub_DollarName '$HOME') <'/expected-stdout'>)} {(DQ ($ Id.VSub_DollarName '$HOME') <'/stdout'>)} ) (C {<stderr_empty_on_success>} {(DQ ($ Id.VSub_DollarName '$expect_code'))}) ] ) ] ) ) (command.ShFunction name: test_expect_success_multiple body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:prereq) op: assign_op.Equal rhs: (word.Empty) spids: [609] ) ] ) (command.If arms: [ (if_arm cond: [(C {<test>} {($ Id.VSub_Pound '$#')} {<-eq>} {<5>})] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:prereq) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [626] ) ] ) (C {<shift>}) ] spids: [612 623] ) ] ) (command.If arms: [ (if_arm cond: [ (C {<test>} {(DQ ($ Id.VSub_Number '$4'))} {<Id.Lit_Equals '='>} {(DQ <--index>)}) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:no_index_opt) op: assign_op.Equal rhs: (word.Empty) spids: [654] ) ] ) ] spids: [636 651] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:no_index_opt) op: assign_op.Equal rhs: {($ Id.VSub_Number '$4')} spids: [660] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:testname) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [667] ) (assign_pair lhs: (sh_lhs_expr.Name name:expect_all) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$2'))} spids: [672] ) (assign_pair lhs: (sh_lhs_expr.Name name:code) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$3'))} spids: [677] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect_verbose) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$expect_all'))}) (C {<grep>} {<-v>} {(SQ <'^::\t'>)}) ] negated: F ) ) } spids: [684] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$expect_verbose'))}) (C {<sed>} {<-e>} {(SQ <'s/.*\t//'>)}) ] negated: F ) ) } spids: [706] ) ] ) (C {<test_expect_success>} {($ Id.VSub_DollarName '$prereq')} { (DQ ($ Id.VSub_DollarName '$testname') (braced_var_sub token: <Id.VSub_Name no_index_opt> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {<' with '> ($ Id.VSub_DollarName '$no_index_opt')} ) ) ) } {(SQ <'\n'> <'\t\texpect "$expect" &&\n'> <'\t\teval "$code"\n'> <'\t'>)} ) (command.If arms: [ (if_arm cond: [ (C {<test>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$expect_all'))}) (C {<wc>} {<-l>}) ] negated: F ) ) } {<Id.Lit_Equals '='>} {<1>} ) ] action: [ (command.ForEach iter_name: quiet_opt iter_words: [{(SQ <-q>)} {(SQ <--quiet>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opts) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name no_index_opt> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {($ Id.VSub_DollarName '$no_index_opt') <' '>} ) ) ($ Id.VSub_DollarName '$quiet_opt') ) } spids: [802] ) ] ) (C {<test_expect_success>} {($ Id.VSub_DollarName '$prereq')} { (DQ ($ Id.VSub_DollarName '$testname') (braced_var_sub token: <Id.VSub_Name opts> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {<' with '> ($ Id.VSub_DollarName '$opts')} ) ) ) } {(DQ <'\n'> <'\t\t\texpect \'\' &&\n'> <'\t\t\t'> ($ Id.VSub_DollarName '$code') <'\n'> <'\t\t'>)} ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:quiet_opt) op: assign_op.Equal rhs: (word.Empty) spids: [841] ) ] ) ] spids: [756 781] ) ] ) (command.ForEach iter_name: verbose_opt iter_words: [{(SQ <-v>)} {(SQ <--verbose>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: non_matching_opt iter_words: [{(SQ )} {(SQ <-n>)} {(SQ <--non-matching>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$non_matching_opt'))}) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:my_expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$expect_all'))} spids: [901] ) ] ) ] spids: [887 898] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:my_expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$expect_verbose'))} spids: [910] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_code) op: assign_op.Equal rhs: { (DQ <'\n'> <'\t\t\t\texpect \''> ($ Id.VSub_DollarName '$my_expect') <'\' &&\n'> <'\t\t\t\t'> ($ Id.VSub_DollarName '$code') <'\n'> <'\t\t\t'> ) } spids: [920] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:opts) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name no_index_opt> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {($ Id.VSub_DollarName '$no_index_opt') <' '>} ) ) ($ Id.VSub_DollarName '$verbose_opt') (braced_var_sub token: <Id.VSub_Name non_matching_opt> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {<' '> ($ Id.VSub_DollarName '$non_matching_opt')} ) ) ) } spids: [933] ) ] ) (C {<test_expect_success>} {($ Id.VSub_DollarName '$prereq')} { (DQ ($ Id.VSub_DollarName '$testname') (braced_var_sub token: <Id.VSub_Name opts> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {<' with '> ($ Id.VSub_DollarName '$opts')} ) ) ) } {(DQ ($ Id.VSub_DollarName '$test_code'))} ) ] ) ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:verbose_opt) op: assign_op.Equal rhs: (word.Empty) spids: [976] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:non_matching_opt) op: assign_op.Equal rhs: (word.Empty) spids: [979] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:no_index_opt) op: assign_op.Equal rhs: (word.Empty) spids: [982] ) ] ) ] ) ) (command.ShFunction name: test_expect_success_multi body: (BraceGroup children: [(C {<test_expect_success_multiple>} {(DQ ($ Id.VSub_At '$@'))} {(DQ <--index>)})] ) ) (command.ShFunction name: test_expect_success_no_index_multi body: (BraceGroup children: [(C {<test_expect_success_multiple>} {(DQ ($ Id.VSub_At '$@'))} {(DQ <--no-index>)})] ) ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\tinit_vars &&\n'> <'\tmkdir -p a/b/ignored-dir a/submodule b &&\n'> <'\tif test_have_prereq SYMLINKS\n'> <'\tthen\n'> <'\t\tln -s b a/symlink\n'> <'\tfi &&\n'> <'\t(\n'> <'\t\tcd a/submodule &&\n'> <'\t\tgit init &&\n'> <'\t\techo a >a &&\n'> <'\t\tgit add a &&\n'> <'\t\tgit commit -m"commit in submodule"\n'> <'\t) &&\n'> <'\tgit add a/submodule &&\n'> <'\tcat <<-\\EOF >.gitignore &&\n'> <'\t\tone\n'> <'\t\tignored-*\n'> <'\t\ttop-level-dir/\n'> <'\tEOF\n'> <'\tfor dir in . a\n'> <'\tdo\n'> <'\t\t: >$dir/not-ignored &&\n'> <'\t\t: >$dir/ignored-and-untracked &&\n'> <'\t\t: >$dir/ignored-but-in-index\n'> <'\tdone &&\n'> <'\tgit add -f ignored-but-in-index a/ignored-but-in-index &&\n'> <'\tcat <<-\\EOF >a/.gitignore &&\n'> <'\t\ttwo*\n'> <'\t\t*three\n'> <'\tEOF\n'> <'\tcat <<-\\EOF >a/b/.gitignore &&\n'> <'\t\tfour\n'> <'\t\tfive\n'> <'\t\t# this comment should affect the line numbers\n'> <'\t\tsix\n'> <'\t\tignored-dir/\n'> <'\t\t# and so should this blank line:\n'> <'\n'> <'\t\t!on*\n'> <'\t\t!two\n'> <'\tEOF\n'> <'\techo "seven" >a/b/ignored-dir/.gitignore &&\n'> <'\ttest -n "$HOME" &&\n'> <'\tcat <<-\\EOF >"$global_excludes" &&\n'> <'\t\tglobalone\n'> <'\t\t!globaltwo\n'> <'\t\tglobalthree\n'> <'\tEOF\n'> <'\tcat <<-\\EOF >>.git/info/exclude\n'> <'\t\tper-repo\n'> <'\tEOF\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'. corner-case'>)} {(SQ <'::\t.'>)} {(SQ <'\n'> <'\ttest_check_ignore . 1\n'>)} ) (C {<test_expect_success_multi>} {(SQ <'empty command line'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "" 128 &&\n'> <'\tstderr_contains "fatal: no path specified"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'--stdin with empty STDIN'>)} {(SQ )} {(SQ <'\n'> <'\ttest_check_ignore "--stdin" 1 </dev/null &&\n'> <'\ttest_stderr ""\n'>)} ) (C {<test_expect_success>} {(SQ <'-q with multiple args'>)} { (SQ <'\n'> <'\texpect "" &&\n'> <'\ttest_check_ignore "-q one two" 128 &&\n'> <'\tstderr_contains "fatal: --quiet is only valid with a single pathname"\n'> ) } ) (C {<test_expect_success>} {(SQ <'--quiet with multiple args'>)} { (SQ <'\n'> <'\texpect "" &&\n'> <'\ttest_check_ignore "--quiet one two" 128 &&\n'> <'\tstderr_contains "fatal: --quiet is only valid with a single pathname"\n'> ) } ) (command.ForEach iter_name: verbose_opt iter_words: [{(SQ <-v>)} {(SQ <--verbose>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: quiet_opt iter_words: [{(SQ <-q>)} {(SQ <--quiet>)}] do_arg_iter: F body: (command.DoGroup children: [ (C {<test_expect_success>} { (DQ ($ Id.VSub_DollarName '$quiet_opt') <' '> ($ Id.VSub_DollarName '$verbose_opt') ) } { (DQ <'\n'> <'\t\t\texpect \'\' &&\n'> <'\t\t\ttest_check_ignore \''> ($ Id.VSub_DollarName '$quiet_opt') <' '> ($ Id.VSub_DollarName '$verbose_opt') <' foo\' 128 &&\n'> < '\t\t\tstderr_contains \'fatal: cannot have both --quiet and --verbose\'\n' > <'\t\t'> ) } ) ] ) ) ] ) ) (C {<test_expect_success>} {(SQ <'--quiet with multiple args'>)} { (SQ <'\n'> <'\texpect "" &&\n'> <'\ttest_check_ignore "--quiet one two" 128 &&\n'> <'\tstderr_contains "fatal: --quiet is only valid with a single pathname"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'erroneous use of --'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "--" 128 &&\n'> <'\tstderr_contains "fatal: no path specified"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'--stdin with superfluous arg'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "--stdin foo" 128 &&\n'> <'\tstderr_contains "fatal: cannot specify pathnames with --stdin"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'--stdin -z with superfluous arg'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "--stdin -z foo" 128 &&\n'> <'\tstderr_contains "fatal: cannot specify pathnames with --stdin"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'-z without --stdin'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "-z" 128 &&\n'> <'\tstderr_contains "fatal: -z only makes sense with --stdin"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'-z without --stdin and superfluous arg'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "-z foo" 128 &&\n'> <'\tstderr_contains "fatal: -z only makes sense with --stdin"\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'needs work tree'>)} {(SQ )} { (SQ <'\n'> <'\t(\n'> <'\t\tcd .git &&\n'> <'\t\ttest_check_ignore "foo" 128\n'> <'\t) &&\n'> <'\tstderr_contains "fatal: This operation must be run in a work tree"\n'> ) } ) (command.ForEach iter_name: subdir iter_words: [{(SQ )} {(SQ <'a/'>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$subdir'))})] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:where) op: assign_op.Equal rhs: {(DQ <'at top-level'>)} spids: [1401] ) ] ) ] spids: [1387 1398] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:where) op: assign_op.Equal rhs: {(DQ <'in subdir '> ($ Id.VSub_DollarName '$subdir'))} spids: [1410] ) ] ) ] ) (C {<test_expect_success_multi>} {(DQ <'non-existent file '> ($ Id.VSub_DollarName '$where') <' not ignored'>)} {(DQ <'::\t'> (${ Id.VSub_Name subdir) <non-existent>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'non-existent\' 1'>)} ) (C {<test_expect_success_no_index_multi>} {(DQ <'non-existent file '> ($ Id.VSub_DollarName '$where') <' not ignored'>)} {(DQ <'::\t'> (${ Id.VSub_Name subdir) <non-existent>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'non-existent\' 1'>)} ) (C {<test_expect_success_multi>} {(DQ <'non-existent file '> ($ Id.VSub_DollarName '$where') <' ignored'>)} {(DQ <'.gitignore:1:one\t'> (${ Id.VSub_Name subdir) <one>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'one\''>)} ) (C {<test_expect_success_no_index_multi>} {(DQ <'non-existent file '> ($ Id.VSub_DollarName '$where') <' ignored'>)} {(DQ <'.gitignore:1:one\t'> (${ Id.VSub_Name subdir) <one>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'one\''>)} ) (C {<test_expect_success_multi>} {(DQ <'existing untracked file '> ($ Id.VSub_DollarName '$where') <' not ignored'>)} {(DQ <'::\t'> (${ Id.VSub_Name subdir) <not-ignored>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'not-ignored\' 1'>)} ) (C {<test_expect_success_no_index_multi>} {(DQ <'existing untracked file '> ($ Id.VSub_DollarName '$where') <' not ignored'>)} {(DQ <'::\t'> (${ Id.VSub_Name subdir) <not-ignored>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'not-ignored\' 1'>)} ) (C {<test_expect_success_multi>} {(DQ <'existing tracked file '> ($ Id.VSub_DollarName '$where') <' not ignored'>)} {(DQ <'::\t'> (${ Id.VSub_Name subdir) <ignored-but-in-index>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'ignored-but-in-index\' 1'>)} ) (C {<test_expect_success_no_index_multi>} {(DQ <'existing tracked file '> ($ Id.VSub_DollarName '$where') <' shown as ignored'>)} {(DQ <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <ignored-but-in-index>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'ignored-but-in-index\''>)} ) (C {<test_expect_success_multi>} {(DQ <'existing untracked file '> ($ Id.VSub_DollarName '$where') <' ignored'>)} {(DQ <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <ignored-and-untracked>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'ignored-and-untracked\''>)} ) (C {<test_expect_success_no_index_multi>} {(DQ <'existing untracked file '> ($ Id.VSub_DollarName '$where') <' ignored'>)} {(DQ <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <ignored-and-untracked>)} {(DQ <'test_check_ignore \''> (${ Id.VSub_Name subdir) <'ignored-and-untracked\''>)} ) (C {<test_expect_success_multi>} {(DQ <'mix of file types '> ($ Id.VSub_DollarName '$where'))} { (DQ <'::\t'> (${ Id.VSub_Name subdir) <'non-existent\n'> <'.gitignore:1:one\t'> (${ Id.VSub_Name subdir) <'one\n'> <'::\t'> (${ Id.VSub_Name subdir) <'not-ignored\n'> <'::\t'> (${ Id.VSub_Name subdir) <'ignored-but-in-index\n'> <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <ignored-and-untracked> ) } { (DQ <'test_check_ignore \'\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'non-existent\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'one\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'not-ignored\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'ignored-but-in-index\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'ignored-and-untracked\'\n'> <'\t\t'> ) } ) (C {<test_expect_success_no_index_multi>} {(DQ <'mix of file types '> ($ Id.VSub_DollarName '$where'))} { (DQ <'::\t'> (${ Id.VSub_Name subdir) <'non-existent\n'> <'.gitignore:1:one\t'> (${ Id.VSub_Name subdir) <'one\n'> <'::\t'> (${ Id.VSub_Name subdir) <'not-ignored\n'> <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <'ignored-but-in-index\n'> <'.gitignore:2:ignored-*\t'> (${ Id.VSub_Name subdir) <ignored-and-untracked> ) } { (DQ <'test_check_ignore \'\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'non-existent\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'one\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'not-ignored\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'ignored-but-in-index\n'> <'\t\t\t'> (${ Id.VSub_Name subdir) <'ignored-and-untracked\'\n'> <'\t\t'> ) } ) ] ) ) (C {<test_expect_success>} {(SQ <'sub-directory local ignore'>)} { (SQ <'\n'> <'\texpect "a/3-three" &&\n'> <'\ttest_check_ignore "a/3-three a/three-not-this-one"\n'> ) } ) (C {<test_expect_success>} {(SQ <'sub-directory local ignore with --verbose'>)} { (SQ <'\n'> <'\texpect "a/.gitignore:2:*three\ta/3-three" &&\n'> <'\ttest_check_ignore "--verbose a/3-three a/three-not-this-one"\n'> ) } ) (C {<test_expect_success>} {(SQ <'local ignore inside a sub-directory'>)} { (SQ <'\n'> <'\texpect "3-three" &&\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "3-three three-not-this-one"\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'local ignore inside a sub-directory with --verbose'>)} { (SQ <'\n'> <'\texpect "a/.gitignore:2:*three\t3-three" &&\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "--verbose 3-three three-not-this-one"\n'> <'\t)\n'> ) } ) (C {<test_expect_success_multi>} {(SQ <'nested include'>)} {(SQ <'a/b/.gitignore:8:!on*\ta/b/one'>)} {(SQ <'\n'> <'\ttest_check_ignore "a/b/one"\n'>)} ) (C {<test_expect_success_multi>} {(SQ <'ignored sub-directory'>)} {(SQ <'a/b/.gitignore:5:ignored-dir/\ta/b/ignored-dir'>)} {(SQ <'\n'> <'\ttest_check_ignore "a/b/ignored-dir"\n'>)} ) (C {<test_expect_success>} {(SQ <'multiple files inside ignored sub-directory'>)} { (SQ <'\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\ta/b/ignored-dir/foo\n'> <'\t\ta/b/ignored-dir/twoooo\n'> <'\t\ta/b/ignored-dir/seven\n'> <'\tEOF\n'> < '\ttest_check_ignore "a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"\n' > ) } ) (C {<test_expect_success>} {(SQ <'multiple files inside ignored sub-directory with -v'>)} { (SQ <'\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\ta/b/ignored-dir/foo\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\ta/b/ignored-dir/twoooo\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\ta/b/ignored-dir/seven\n'> <'\tEOF\n'> < '\ttest_check_ignore "-v a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"\n' > ) } ) (C {<test_expect_success>} {(SQ <'cd to ignored sub-directory'>)} { (SQ <'\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\tfoo\n'> <'\t\ttwoooo\n'> <'\t\t../one\n'> <'\t\tseven\n'> <'\t\t../../one\n'> <'\tEOF\n'> <'\t(\n'> <'\t\tcd a/b/ignored-dir &&\n'> <'\t\ttest_check_ignore "foo twoooo ../one seven ../../one"\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'cd to ignored sub-directory with -v'>)} { (SQ <'\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\tfoo\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\ttwoooo\n'> <'\t\ta/b/.gitignore:8:!on*\t../one\n'> <'\t\ta/b/.gitignore:5:ignored-dir/\tseven\n'> <'\t\t.gitignore:1:one\t../../one\n'> <'\tEOF\n'> <'\t(\n'> <'\t\tcd a/b/ignored-dir &&\n'> <'\t\ttest_check_ignore "-v foo twoooo ../one seven ../../one"\n'> <'\t)\n'> ) } ) (C {<test_expect_success_multi>} {<SYMLINKS>} {(SQ <symlink>)} {(SQ <'::\ta/symlink'>)} {(SQ <'\n'> <'\ttest_check_ignore "a/symlink" 1\n'>)} ) (C {<test_expect_success_multi>} {<SYMLINKS>} {(SQ <'beyond a symlink'>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "a/symlink/foo" 128 &&\n'> <'\ttest_stderr "fatal: pathspec '>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'a/symlink/foo'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <' is beyond a symbolic link"\n'>) } ) (C {<test_expect_success_multi>} {<SYMLINKS>} {(SQ <'beyond a symlink from subdirectory'>)} {(SQ )} { (SQ <'\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "symlink/foo" 128\n'> <'\t) &&\n'> <'\ttest_stderr "fatal: pathspec '> ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'symlink/foo'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <' is beyond a symbolic link"\n'>) } ) (C {<test_expect_success_multi>} {(SQ <submodule>)} {(SQ )} { (SQ <'\n'> <'\ttest_check_ignore "a/submodule/one" 128 &&\n'> <'\ttest_stderr "fatal: Pathspec '> ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'a/submodule/one'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <' is in submodule '>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'a/submodule'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'"\n'>) } ) (C {<test_expect_success_multi>} {(SQ <'submodule from subdirectory'>)} {(SQ )} { (SQ <'\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "submodule/one" 128\n'> <'\t) &&\n'> <'\ttest_stderr "fatal: Pathspec '> ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'submodule/one'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <' is in submodule '>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'a/submodule'>) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\''>) (SQ <'"\n'>) } ) (C {<test_expect_success>} {(SQ <'global ignore not yet enabled'>)} { (SQ <'\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\t.git/info/exclude:7:per-repo\tper-repo\n'> <'\t\ta/.gitignore:2:*three\ta/globalthree\n'> <'\t\t.git/info/exclude:7:per-repo\ta/per-repo\n'> <'\tEOF\n'> <'\ttest_check_ignore "-v globalone per-repo a/globalthree a/per-repo not-ignored a/globaltwo"\n'> ) } ) (C {<test_expect_success>} {(SQ <'global ignore'>)} { (SQ <'\n'> <'\tenable_global_excludes &&\n'> <'\texpect_from_stdin <<-\\EOF &&\n'> <'\t\tglobalone\n'> <'\t\tper-repo\n'> <'\t\tglobalthree\n'> <'\t\ta/globalthree\n'> <'\t\ta/per-repo\n'> <'\t\tglobaltwo\n'> <'\tEOF\n'> < '\ttest_check_ignore "globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"\n' > ) } ) (C {<test_expect_success>} {(SQ <'global ignore with -v'>)} { (SQ <'\n'> <'\tenable_global_excludes &&\n'> <'\texpect_from_stdin <<-EOF &&\n'> <'\t\t$global_excludes:1:globalone\tglobalone\n'> <'\t\t.git/info/exclude:7:per-repo\tper-repo\n'> <'\t\t$global_excludes:3:globalthree\tglobalthree\n'> <'\t\ta/.gitignore:2:*three\ta/globalthree\n'> <'\t\t.git/info/exclude:7:per-repo\ta/per-repo\n'> <'\t\t$global_excludes:2:!globaltwo\tglobaltwo\n'> <'\tEOF\n'> < '\ttest_check_ignore "-v globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"\n' > ) } ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 2314 stdin_parts: [ <'one\n'> <'not-ignored\n'> <'a/one\n'> <'a/not-ignored\n'> <'a/b/on\n'> <'a/b/one\n'> <'a/b/one one\n'> <'"a/b/one two"\n'> <'"a/b/one\\"three"\n'> <'a/b/not-ignored\n'> <'a/b/two\n'> <'a/b/twooo\n'> <'globaltwo\n'> <'a/globaltwo\n'> <'a/b/globaltwo\n'> <'b/globaltwo\n'> ] ) ) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<stdin>}) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 2337 stdin_parts: [ <'one\n'> <'a/one\n'> <'a/b/on\n'> <'a/b/one\n'> <'a/b/one one\n'> <'a/b/one two\n'> <'"a/b/one\\"three"\n'> <'a/b/two\n'> <'a/b/twooo\n'> <'globaltwo\n'> <'a/globaltwo\n'> <'a/b/globaltwo\n'> <'b/globaltwo\n'> ] ) ) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-default>}) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {<EOF>} here_end_span_id: 2371 stdin_parts: [ <'.gitignore:1:one\tone\n'> <'.gitignore:1:one\ta/one\n'> <'a/b/.gitignore:8:!on*\ta/b/on\n'> <'a/b/.gitignore:8:!on*\ta/b/one\n'> <'a/b/.gitignore:8:!on*\ta/b/one one\n'> <'a/b/.gitignore:8:!on*\ta/b/one two\n'> <'a/b/.gitignore:8:!on*\t'> <Id.Right_DoubleQuote '"'> <'a/b/one'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'>) <Id.Right_DoubleQuote '"'> <three> <Id.Right_DoubleQuote '"'> <'\n'> <'a/b/.gitignore:9:!two\ta/b/two\n'> <'a/.gitignore:1:two*\ta/b/twooo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\tglobaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\ta/globaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\ta/b/globaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\tb/globaltwo\n'> ] ) ) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-verbose>}) ] do_fork: T ) (command.Simple words: [{<broken_c_unquote>} {<stdin>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<stdin0>})] do_fork: T ) (command.Simple words: [{<broken_c_unquote>} {<expected-default>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-default0>})] do_fork: T ) (command.Simple words: [{<broken_c_unquote_verbose>} {<expected-verbose>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-verbose0>})] do_fork: T ) (C {<test_expect_success>} {(SQ <--stdin>)} { (SQ <'\n'> <'\texpect_from_stdin <expected-default &&\n'> <'\ttest_check_ignore "--stdin" <stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'--stdin -q'>)} {(SQ <'\n'> <'\texpect "" &&\n'> <'\ttest_check_ignore "-q --stdin" <stdin\n'>)} ) (C {<test_expect_success>} {(SQ <'--stdin -v'>)} { (SQ <'\n'> <'\texpect_from_stdin <expected-verbose &&\n'> <'\ttest_check_ignore "-v --stdin" <stdin\n'> ) } ) (command.ForEach iter_name: opts iter_words: [{(SQ <'--stdin -z'>)} {(SQ <'-z --stdin'>)}] do_arg_iter: F body: (command.DoGroup children: [ (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$opts'))} { (DQ <'\n'> <'\t\texpect_from_stdin <expected-default0 &&\n'> <'\t\ttest_check_ignore \''> ($ Id.VSub_DollarName '$opts') <'\' <stdin0\n'> <'\t'> ) } ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$opts') <' -q'>)} {(DQ <'\n'> <'\t\texpect '>) (DQ <' &&\n'> <'\t\ttest_check_ignore \'-q '> ($ Id.VSub_DollarName '$opts') <'\' <stdin0\n'> <'\t'> ) } ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$opts') <' -v'>)} { (DQ <'\n'> <'\t\texpect_from_stdin <expected-verbose0 &&\n'> <'\t\ttest_check_ignore \'-v '> ($ Id.VSub_DollarName '$opts') <'\' <stdin0\n'> <'\t'> ) } ) ] ) ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'>) <OF>} here_end_span_id: 2536 stdin_parts: [ <'../one\n'> <'../not-ignored\n'> <'one\n'> <'not-ignored\n'> <'b/on\n'> <'b/one\n'> <'b/one one\n'> <'"b/one two"\n'> <'"b/one\\"three"\n'> <'b/two\n'> <'b/not-ignored\n'> <'b/twooo\n'> <'../globaltwo\n'> <'globaltwo\n'> <'b/globaltwo\n'> <'../b/globaltwo\n'> <'c/not-ignored\n'> ] ) ) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<stdin>}) ] do_fork: T ) (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLessDash '<<-'> loc: (redir_loc.Fd fd:0) arg: (redir_param.MultiLine here_begin: {<EOF>} here_end_span_id: 2587 stdin_parts: [ <'.gitignore:1:one\t../one\n'> <'::\t../not-ignored\n'> <'.gitignore:1:one\tone\n'> <'::\tnot-ignored\n'> <'a/b/.gitignore:8:!on*\tb/on\n'> <'a/b/.gitignore:8:!on*\tb/one\n'> <'a/b/.gitignore:8:!on*\tb/one one\n'> <'a/b/.gitignore:8:!on*\tb/one two\n'> <'a/b/.gitignore:8:!on*\t'> <Id.Right_DoubleQuote '"'> <'b/one'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'>) <Id.Right_DoubleQuote '"'> <three> <Id.Right_DoubleQuote '"'> <'\n'> <'a/b/.gitignore:9:!two\tb/two\n'> <'::\tb/not-ignored\n'> <'a/.gitignore:1:two*\tb/twooo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\t../globaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\tglobaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\tb/globaltwo\n'> ($ Id.VSub_DollarName '$global_excludes') <':2:!globaltwo\t../b/globaltwo\n'> <'::\tc/not-ignored\n'> ] ) ) (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-all>}) ] do_fork: T ) (command.Simple words: [{<grep>} {<-v>} {(SQ <'^::\t'>)} {<expected-all>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-verbose>})] do_fork: T ) (command.Simple words: [{<sed>} {<-e>} {(SQ <'s/.*\t//'>)} {<expected-verbose>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-default>})] do_fork: T ) (command.Simple words: [{<broken_c_unquote>} {<stdin>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<stdin0>})] do_fork: T ) (command.Simple words: [{<broken_c_unquote>} {<expected-default>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-default0>})] do_fork: T ) (command.Simple words: [{<broken_c_unquote_verbose>} {<expected-verbose>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected-verbose0>})] do_fork: T ) (C {<test_expect_success>} {(SQ <'--stdin from subdirectory'>)} { (SQ <'\n'> <'\texpect_from_stdin <expected-default &&\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "--stdin" <../stdin\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'--stdin from subdirectory with -v'>)} { (SQ <'\n'> <'\texpect_from_stdin <expected-verbose &&\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "--stdin -v" <../stdin\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'--stdin from subdirectory with -v -n'>)} { (SQ <'\n'> <'\texpect_from_stdin <expected-all &&\n'> <'\t(\n'> <'\t\tcd a &&\n'> <'\t\ttest_check_ignore "--stdin -v -n" <../stdin\n'> <'\t)\n'> ) } ) (command.ForEach iter_name: opts iter_words: [{(SQ <'--stdin -z'>)} {(SQ <'-z --stdin'>)}] do_arg_iter: F body: (command.DoGroup children: [ (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$opts') <' from subdirectory'>)} { (SQ <'\n'> <'\t\texpect_from_stdin <expected-default0 &&\n'> <'\t\t(\n'> <'\t\t\tcd a &&\n'> <'\t\t\ttest_check_ignore "'> ) (DQ ($ Id.VSub_DollarName '$opts')) (SQ <'" <../stdin0\n'> <'\t\t)\n'> <'\t'>) } ) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$opts') <' from subdirectory with -v'>)} { (SQ <'\n'> <'\t\texpect_from_stdin <expected-verbose0 &&\n'> <'\t\t(\n'> <'\t\t\tcd a &&\n'> <'\t\t\ttest_check_ignore "'> ) (DQ ($ Id.VSub_DollarName '$opts')) (SQ <' -v" <../stdin0\n'> <'\t\t)\n'> <'\t'>) } ) ] ) ) (C {<test_expect_success>} {<PIPE>} {(SQ <'streaming support for --stdin'>)} { (SQ <'\n'> <'\tmkfifo in out &&\n'> <'\t(git check-ignore -n -v --stdin <in >out &) &&\n'> <'\n'> <'\t# We cannot just "echo >in" because check-ignore would get EOF\n'> <'\t# after echo exited; instead we open the descriptor in our\n'> <'\t# shell, and then echo to the fd. We make sure to close it at\n'> <'\t# the end, so that the subprocess does get EOF and dies\n'> <'\t# properly.\n'> <'\t#\n'> <'\t# Similarly, we must keep "out" open so that check-ignore does\n'> <'\t# not ever get SIGPIPE trying to write to us. Not only would that\n'> <'\t# produce incorrect results, but then there would be no writer on the\n'> <'\t# other end of the pipe, and we would potentially block forever trying\n'> <'\t# to open it.\n'> <'\texec 9>in &&\n'> <'\texec 8<out &&\n'> <'\ttest_when_finished "exec 9>&-" &&\n'> <'\ttest_when_finished "exec 8<&-" &&\n'> <'\techo >&9 one &&\n'> <'\tread response <&8 &&\n'> <'\techo "$response" | grep "^\\.gitignore:1:one\tone" &&\n'> <'\techo >&9 two &&\n'> <'\tread response <&8 &&\n'> <'\techo "$response" | grep "^::\ttwo"\n'> ) } ) (C {<test_expect_success>} {(SQ <'trailing whitespace is ignored'>)} { (SQ <'\n'> <'\tmkdir whitespace &&\n'> <'\t>whitespace/trailing &&\n'> <'\t>whitespace/untracked &&\n'> <'\techo "whitespace/trailing " >ignore &&\n'> <'\tcat >expect <<EOF &&\n'> <'whitespace/untracked\n'> <'EOF\n'> <'\t: >err.expect &&\n'> <'\tgit ls-files -o -X ignore whitespace >actual 2>err &&\n'> <'\ttest_cmp expect actual &&\n'> <'\ttest_cmp err.expect err\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'quoting allows trailing whitespace'>)} { (SQ <'\n'> <'\trm -rf whitespace &&\n'> <'\tmkdir whitespace &&\n'> <'\t>"whitespace/trailing " &&\n'> <'\t>whitespace/untracked &&\n'> <'\techo "whitespace/trailing\\\\ \\\\ " >ignore &&\n'> <'\techo whitespace/untracked >expect &&\n'> <'\t: >err.expect &&\n'> <'\tgit ls-files -o -X ignore whitespace >actual 2>err &&\n'> <'\ttest_cmp expect actual &&\n'> <'\ttest_cmp err.expect err\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW> <Id.Lit_Comma ','> <Id.KW_Bang '!'> <CYGWIN>} {(SQ <'correct handling of backslashes'>)} { (SQ <'\n'> <'\trm -rf whitespace &&\n'> <'\tmkdir whitespace &&\n'> <'\t>"whitespace/trailing 1 " &&\n'> <'\t>"whitespace/trailing 2 \\\\\\\\" &&\n'> <'\t>"whitespace/trailing 3 \\\\\\\\" &&\n'> <'\t>"whitespace/trailing 4 \\\\ " &&\n'> <'\t>"whitespace/trailing 5 \\\\ \\\\ " &&\n'> <'\t>"whitespace/trailing 6 \\\\a\\\\" &&\n'> <'\t>whitespace/untracked &&\n'> <'\tsed -e "s/Z$//" >ignore <<-\\EOF &&\n'> <'\twhitespace/trailing 1 \\ Z\n'> <'\twhitespace/trailing 2 \\\\\\\\Z\n'> <'\twhitespace/trailing 3 \\\\\\\\ Z\n'> <'\twhitespace/trailing 4 \\\\\\ Z\n'> <'\twhitespace/trailing 5 \\\\ \\\\\\ Z\n'> <'\twhitespace/trailing 6 \\\\a\\\\Z\n'> <'\tEOF\n'> <'\techo whitespace/untracked >expect &&\n'> <'\t>err.expect &&\n'> <'\tgit ls-files -o -X ignore whitespace >actual 2>err &&\n'> <'\ttest_cmp expect actual &&\n'> <'\ttest_cmp err.expect err\n'> ) } ) (C {<test_expect_success>} {(SQ <'info/exclude trumps core.excludesfile'>)} { (SQ <'\n'> <'\techo >>global-excludes usually-ignored &&\n'> <'\techo >>.git/info/exclude "!usually-ignored" &&\n'> <'\t>usually-ignored &&\n'> <'\techo "?? usually-ignored" >expect &&\n'> <'\n'> <'\tgit status --porcelain usually-ignored >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_done>}) ] )