(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_description) op:Equal rhs:{(check-ignore)})] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: init_vars body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:global_excludes) op: Equal rhs: {(DQ (global-excludes))} ) ] ) ] ) ) (command.FuncDef name: enable_global_excludes body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(init_vars)}) (C {(git)} {(config)} {(core.excludesfile)} {(DQ ($ VSub_DollarName '$global_excludes'))}) ] ) ] ) ) (command.FuncDef name: expect_in body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:dest) op: Equal rhs: {(DQ ($ VSub_DollarName '$HOME') (/expected-) ($ VSub_Number '$1'))} ) (assign_pair lhs: (lhs_expr.LhsName name:text) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$text'))})] action: [ (command.SimpleCommand redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$dest'))} ) ] ) ] ) ] else_action: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$text'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$dest'))} ) ] ) ] ) ] ) ) (command.FuncDef name: expect body: (command.BraceGroup children:[(C {(expect_in)} {(stdout)} {(DQ ($ VSub_Number '$1'))})]) ) (command.FuncDef name: expect_from_stdin body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$HOME') (/expected-stdout))} ) ] ) ] ) ) (command.FuncDef name: test_stderr body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expected) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(expect_in)} {(stderr)} {(DQ ($ VSub_Number '$1'))}) (C {(test_i18ncmp)} {(DQ ($ VSub_DollarName '$HOME') (/expected-stderr))} {(DQ ($ VSub_DollarName '$HOME') (/stderr))} ) ] ) ] ) ) (command.FuncDef name: broken_c_unquote body: (command.BraceGroup children: [ (C {(DQ ($ VSub_DollarName '$PERL_PATH'))} {(-pe)} {(SQ <'s/^"//; s/\\\\//; s/"$//; tr/\\n/\\0/'>)} {(DQ ($ VSub_At '$@'))} ) ] ) ) (command.FuncDef name: broken_c_unquote_verbose body: (command.BraceGroup children: [ (C {(DQ ($ VSub_DollarName '$PERL_PATH'))} {(-pe)} {(SQ <'s/\t"/\t/; s/\\\\//; s/"$//; tr/:\\t\\n/\\0/'>)} {(DQ ($ VSub_At '$@'))} ) ] ) ) (command.FuncDef name: stderr_contains body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:regexp) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.If arms: [ (if_arm cond: [ (C {(test_i18ngrep)} {(DQ ($ VSub_DollarName '$regexp'))} {(DQ ($ VSub_DollarName '$HOME') (/stderr))} ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] else_action: [ (C {(echo)} { (DQ ("didn't find /") ($ VSub_DollarName '$regexp') ('/ in ') ($ VSub_DollarName '$HOME') (/stderr) ) } ) (C {(cat)} {(DQ ($ VSub_DollarName '$HOME') (/stderr))}) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ] ) ) (command.FuncDef name: stderr_empty_on_success body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expect_code) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_DollarName '$expect_code')} {(Lit_Other '=')} {(0)})] action: [(C {(test_stderr)} {(DQ )})] ) ] else_action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) ) (command.FuncDef name: test_check_ignore body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:args) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) (assign_pair lhs: (lhs_expr.LhsName name:expect_code) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(0)}) ) ) } ) (assign_pair lhs: (lhs_expr.LhsName name:global_args) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(init_vars)}) (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$HOME') (/stdout))} {(DQ ($ VSub_DollarName '$HOME') (/stderr))} {(DQ ($ VSub_DollarName '$HOME') (/cmd))} ) (command.SimpleCommand words: [ {(echo)} {(git)} {($ VSub_DollarName '$global_args')} {(check-ignore)} {($ VSub_DollarName '$quiet_opt')} {($ VSub_DollarName '$verbose_opt')} {($ VSub_DollarName '$non_matching_opt')} {($ VSub_DollarName '$no_index_opt')} {($ VSub_DollarName '$args')} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$HOME') (/cmd))} ) ] ) (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_DollarName '$expect_code'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$HOME') (/expected-exit-code))} ) ] ) (command.SimpleCommand words: [ {(test_expect_code)} {(DQ ($ VSub_DollarName '$expect_code'))} {(git)} {($ VSub_DollarName '$global_args')} {(check-ignore)} {($ VSub_DollarName '$quiet_opt')} {($ VSub_DollarName '$verbose_opt')} {($ VSub_DollarName '$non_matching_opt')} {($ VSub_DollarName '$no_index_opt')} {($ VSub_DollarName '$args')} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$HOME') (/stdout))} ) (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(DQ ($ VSub_DollarName '$HOME') (/stderr))} ) ] ) (C {(test_cmp)} {(DQ ($ VSub_DollarName '$HOME') (/expected-stdout))} {(DQ ($ VSub_DollarName '$HOME') (/stdout))} ) (C {(stderr_empty_on_success)} {(DQ ($ VSub_DollarName '$expect_code'))}) ] ) ] ) ) (command.FuncDef name: test_expect_success_multiple body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:prereq) op:Equal rhs:(word.EmptyWord))] ) (command.If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound '$#')} {(-eq)} {(5)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:prereq) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (C {(shift)}) ] ) ] ) (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Number '$4'))} {(Lit_Other '=')} {(DQ (--index))})] action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:no_index_opt) op:Equal rhs:(word.EmptyWord))] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:no_index_opt) op: Equal rhs: {($ VSub_Number '$4')} ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:testname) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) (assign_pair lhs: (lhs_expr.LhsName name:expect_all) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) (assign_pair lhs: (lhs_expr.LhsName name:code) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expect_verbose) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$expect_all'))}) (C {(grep)} {(-v)} {(SQ <'^::\t'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expect) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$expect_verbose'))}) (C {(sed)} {(-e)} {(SQ <'s/.*\t//'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(test_expect_success)} {($ VSub_DollarName '$prereq')} { (DQ ($ VSub_DollarName '$testname') (word_part.BracedVarSub token: <VSub_Name no_index_opt> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(' with ') ($ VSub_DollarName '$no_index_opt')} ) ) ) } {(SQ <'\n'> <'\t\texpect "$expect" &&\n'> <'\t\teval "$code"\n'> <'\t'>)} ) (command.If arms: [ (if_arm cond: [ (C {(test)} { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$expect_all'))}) (C {(wc)} {(-l)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> ) } {(Lit_Other '=')} {(1)} ) ] action: [ (command.ForEach iter_name: quiet_opt iter_words: [{(SQ <-q>)} {(SQ <--quiet>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opts) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name no_index_opt> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {($ VSub_DollarName '$no_index_opt') (' ')} ) ) ($ VSub_DollarName '$quiet_opt') ) } ) ] ) (C {(test_expect_success)} {($ VSub_DollarName '$prereq')} { (DQ ($ VSub_DollarName '$testname') (word_part.BracedVarSub token: <VSub_Name opts> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(' with ') ($ VSub_DollarName '$opts')} ) ) ) } {(DQ ('\n') ("\t\t\texpect '' &&\n") ('\t\t\t') ($ VSub_DollarName '$code') ('\n') ('\t\t'))} ) ] ) ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:quiet_opt) op:Equal rhs:(word.EmptyWord))] ) ] ) ] ) (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 ($ VSub_DollarName '$non_matching_opt'))}) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:my_expect) op: Equal rhs: {(DQ ($ VSub_DollarName '$expect_all'))} ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:my_expect) op: Equal rhs: {(DQ ($ VSub_DollarName '$expect_verbose'))} ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_code) op: Equal rhs: { (DQ ('\n') ("\t\t\t\texpect '") ($ VSub_DollarName '$my_expect') ("' &&\n") ('\t\t\t\t') ($ VSub_DollarName '$code') ('\n') ('\t\t\t') ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opts) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name no_index_opt> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {($ VSub_DollarName '$no_index_opt') (' ')} ) ) ($ VSub_DollarName '$verbose_opt') (word_part.BracedVarSub token: <VSub_Name non_matching_opt> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(' ') ($ VSub_DollarName '$non_matching_opt')} ) ) ) } ) ] ) (C {(test_expect_success)} {($ VSub_DollarName '$prereq')} { (DQ ($ VSub_DollarName '$testname') (word_part.BracedVarSub token: <VSub_Name opts> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonPlus arg_word: {(' with ') ($ VSub_DollarName '$opts')} ) ) ) } {(DQ ($ VSub_DollarName '$test_code'))} ) ] ) ) ] ) ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:verbose_opt) op:Equal rhs:(word.EmptyWord))] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:non_matching_opt) op:Equal rhs:(word.EmptyWord))] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:no_index_opt) op:Equal rhs:(word.EmptyWord))] ) ] ) ) (command.FuncDef name: test_expect_success_multi body: (command.BraceGroup children: [(C {(test_expect_success_multiple)} {(DQ ($ VSub_At '$@'))} {(DQ (--index))})] ) ) (command.FuncDef name: test_expect_success_no_index_multi body: (command.BraceGroup children: [(C {(test_expect_success_multiple)} {(DQ ($ 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 ($ VSub_DollarName '$quiet_opt') (' ') ($ VSub_DollarName '$verbose_opt'))} { (DQ ('\n') ("\t\t\texpect '' &&\n") ("\t\t\ttest_check_ignore '") ($ VSub_DollarName '$quiet_opt') (' ') ($ 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 ($ VSub_DollarName '$subdir'))})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:where) op: Equal rhs: {(DQ ('at top-level'))} ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:where) op: Equal rhs: {(DQ ('in subdir ') ($ VSub_DollarName '$subdir'))} ) ] ) ] ) (C {(test_expect_success_multi)} {(DQ ('non-existent file ') ($ VSub_DollarName '$where') (' not ignored'))} {(DQ ('::\t') (${ VSub_Name subdir) (non-existent))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("non-existent' 1"))} ) (C {(test_expect_success_no_index_multi)} {(DQ ('non-existent file ') ($ VSub_DollarName '$where') (' not ignored'))} {(DQ ('::\t') (${ VSub_Name subdir) (non-existent))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("non-existent' 1"))} ) (C {(test_expect_success_multi)} {(DQ ('non-existent file ') ($ VSub_DollarName '$where') (' ignored'))} {(DQ ('.gitignore:1:one\t') (${ VSub_Name subdir) (one))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("one'"))} ) (C {(test_expect_success_no_index_multi)} {(DQ ('non-existent file ') ($ VSub_DollarName '$where') (' ignored'))} {(DQ ('.gitignore:1:one\t') (${ VSub_Name subdir) (one))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("one'"))} ) (C {(test_expect_success_multi)} {(DQ ('existing untracked file ') ($ VSub_DollarName '$where') (' not ignored'))} {(DQ ('::\t') (${ VSub_Name subdir) (not-ignored))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("not-ignored' 1"))} ) (C {(test_expect_success_no_index_multi)} {(DQ ('existing untracked file ') ($ VSub_DollarName '$where') (' not ignored'))} {(DQ ('::\t') (${ VSub_Name subdir) (not-ignored))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("not-ignored' 1"))} ) (C {(test_expect_success_multi)} {(DQ ('existing tracked file ') ($ VSub_DollarName '$where') (' not ignored'))} {(DQ ('::\t') (${ VSub_Name subdir) (ignored-but-in-index))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("ignored-but-in-index' 1"))} ) (C {(test_expect_success_no_index_multi)} {(DQ ('existing tracked file ') ($ VSub_DollarName '$where') (' shown as ignored'))} {(DQ ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) (ignored-but-in-index))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("ignored-but-in-index'"))} ) (C {(test_expect_success_multi)} {(DQ ('existing untracked file ') ($ VSub_DollarName '$where') (' ignored'))} {(DQ ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) (ignored-and-untracked))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("ignored-and-untracked'"))} ) (C {(test_expect_success_no_index_multi)} {(DQ ('existing untracked file ') ($ VSub_DollarName '$where') (' ignored'))} {(DQ ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) (ignored-and-untracked))} {(DQ ("test_check_ignore '") (${ VSub_Name subdir) ("ignored-and-untracked'"))} ) (C {(test_expect_success_multi)} {(DQ ('mix of file types ') ($ VSub_DollarName '$where'))} { (DQ ('::\t') (${ VSub_Name subdir) ('non-existent\n') ('.gitignore:1:one\t') (${ VSub_Name subdir) ('one\n') ('::\t') (${ VSub_Name subdir) ('not-ignored\n') ('::\t') (${ VSub_Name subdir) ('ignored-but-in-index\n') ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) (ignored-and-untracked) ) } { (DQ ("test_check_ignore '\n") ('\t\t\t') (${ VSub_Name subdir) ('non-existent\n') ('\t\t\t') (${ VSub_Name subdir) ('one\n') ('\t\t\t') (${ VSub_Name subdir) ('not-ignored\n') ('\t\t\t') (${ VSub_Name subdir) ('ignored-but-in-index\n') ('\t\t\t') (${ VSub_Name subdir) ("ignored-and-untracked'\n") ('\t\t') ) } ) (C {(test_expect_success_no_index_multi)} {(DQ ('mix of file types ') ($ VSub_DollarName '$where'))} { (DQ ('::\t') (${ VSub_Name subdir) ('non-existent\n') ('.gitignore:1:one\t') (${ VSub_Name subdir) ('one\n') ('::\t') (${ VSub_Name subdir) ('not-ignored\n') ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) ('ignored-but-in-index\n') ('.gitignore:2:ignored-*\t') (${ VSub_Name subdir) (ignored-and-untracked) ) } { (DQ ("test_check_ignore '\n") ('\t\t\t') (${ VSub_Name subdir) ('non-existent\n') ('\t\t\t') (${ VSub_Name subdir) ('one\n') ('\t\t\t') (${ VSub_Name subdir) ('not-ignored\n') ('\t\t\t') (${ VSub_Name subdir) ('ignored-but-in-index\n') ('\t\t\t') (${ 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.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/symlink/foo>) (word_part.EscapedLiteralPart token:<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.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <symlink/foo>) (word_part.EscapedLiteralPart token:<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.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule/one>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <' is in submodule '>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule>) (word_part.EscapedLiteralPart token:<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.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <submodule/one>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <' is in submodule '>) (word_part.EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule>) (word_part.EscapedLiteralPart token:<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.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<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.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(stdin)}) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<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.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-default)}) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 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') (Right_DoubleQuote '"') (a/b/one) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) (Right_DoubleQuote '"') (three) (Right_DoubleQuote '"') ('\n') ('a/b/.gitignore:9:!two\ta/b/two\n') ('a/.gitignore:1:two*\ta/b/twooo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\tglobaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\ta/globaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\ta/b/globaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\tb/globaltwo\n') ] ) (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-verbose)}) ] ) (command.SimpleCommand words: [{(broken_c_unquote)} {(stdin)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(stdin0)})] ) (command.SimpleCommand words: [{(broken_c_unquote)} {(expected-default)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-default0)})] ) (command.SimpleCommand words: [{(broken_c_unquote_verbose)} {(expected-verbose)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-verbose0)})] ) (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 ($ VSub_DollarName '$opts'))} { (DQ ('\n') ('\t\texpect_from_stdin <expected-default0 &&\n') ("\t\ttest_check_ignore '") ($ VSub_DollarName '$opts') ("' <stdin0\n") ('\t') ) } ) (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$opts') (' -q'))} {(DQ ('\n') ('\t\texpect ')) (DQ (' &&\n') ("\t\ttest_check_ignore '-q ") ($ VSub_DollarName '$opts') ("' <stdin0\n") ('\t') ) } ) (C {(test_expect_success)} {(DQ ($ VSub_DollarName '$opts') (' -v'))} { (DQ ('\n') ('\t\texpect_from_stdin <expected-verbose0 &&\n') ("\t\ttest_check_ignore '-v ") ($ VSub_DollarName '$opts') ("' <stdin0\n") ('\t') ) } ) ] ) ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<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.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(stdin)}) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 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') (Right_DoubleQuote '"') (b/one) (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) (Right_DoubleQuote '"') (three) (Right_DoubleQuote '"') ('\n') ('a/b/.gitignore:9:!two\tb/two\n') ('::\tb/not-ignored\n') ('a/.gitignore:1:two*\tb/twooo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\t../globaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\tglobaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\tb/globaltwo\n') ($ VSub_DollarName '$global_excludes') (':2:!globaltwo\t../b/globaltwo\n') ('::\tc/not-ignored\n') ] ) (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-all)}) ] ) (command.SimpleCommand words: [{(grep)} {(-v)} {(SQ <'^::\t'>)} {(expected-all)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-verbose)})] ) (command.SimpleCommand words: [{(sed)} {(-e)} {(SQ <'s/.*\t//'>)} {(expected-verbose)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-default)})] ) (command.SimpleCommand words: [{(broken_c_unquote)} {(stdin)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(stdin0)})] ) (command.SimpleCommand words: [{(broken_c_unquote)} {(expected-default)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-default0)})] ) (command.SimpleCommand words: [{(broken_c_unquote_verbose)} {(expected-verbose)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected-verbose0)})] ) (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 ($ 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 ($ VSub_DollarName '$opts')) (SQ <'" <../stdin0\n'> <'\t\t)\n'> <'\t'>) } ) (C {(test_expect_success)} {(DQ ($ 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 ($ 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)} {(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)} {(KW_Bang '!') (MINGW) (Lit_Comma ',') (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)}) ] )