(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(check-ignore)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (FuncDef
      name: init_vars
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:global_excludes)
                  op: Equal
                  rhs: {(DQ (global-excludes))}
                  spids: [21]
                )
              ]
              spids: [21]
            )
          ]
          spids: [18]
        )
      spids: [13 17]
    )
    (FuncDef
      name: enable_global_excludes
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(init_vars)})
                (C {(git)} {(config)} {(core.excludesfile)} {(DQ ($ VSub_Name "$global_excludes"))})
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [34]
        )
      spids: [29 33]
    )
    (FuncDef
      name: expect_in
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:dest)
                  op: Equal
                  rhs: {(DQ ($ VSub_Name "$HOME") (/expected-) ($ VSub_Number "$1"))}
                  spids: [63]
                )
                (assign_pair
                  lhs: (LhsName name:text)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$2"))}
                  spids: [70]
                )
              ]
              spids: [63]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name "$text"))})]
                  action: [
                    (SimpleCommand
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$dest"))}
                          spids: [90]
                        )
                      ]
                    )
                  ]
                  spids: [-1 87]
                )
              ]
              else_action: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ($ VSub_Name "$text"))}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$dest"))}
                      spids: [108]
                    )
                  ]
                )
              ]
              spids: [99 114]
            )
          ]
          spids: [60]
        )
      spids: [55 59]
    )
    (FuncDef
      name: expect
      body: 
        (BraceGroup
          children: [(C {(expect_in)} {(stdout)} {(DQ ($ VSub_Number "$1"))})]
          spids: [124]
        )
      spids: [119 123]
    )
    (FuncDef
      name: expect_from_stdin
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(DQ ($ VSub_Name "$HOME") (/expected-stdout))}
                  spids: [148]
                )
              ]
            )
          ]
          spids: [143]
        )
      spids: [138 142]
    )
    (FuncDef
      name: test_stderr
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expected)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [165]
                )
              ]
              spids: [165]
            )
            (AndOr
              children: [
                (C {(expect_in)} {(stderr)} {(DQ ($ VSub_Number "$1"))})
                (C {(test_i18ncmp)} {(DQ ($ VSub_Name "$HOME") (/expected-stderr))} 
                  {(DQ ($ VSub_Name "$HOME") (/stderr))}
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [162]
        )
      spids: [157 161]
    )
    (FuncDef
      name: broken_c_unquote
      body: 
        (BraceGroup
          children: [
            (C {(DQ ($ VSub_Name "$PERL_PATH"))} {(-pe)} 
              {(SQ <"s/^\"//; s/\\\\//; s/\"$//; tr/\\n/\\0/">)} {(DQ ($ VSub_At "$@"))}
            )
          ]
          spids: [202]
        )
      spids: [197 201]
    )
    (FuncDef
      name: broken_c_unquote_verbose
      body: 
        (BraceGroup
          children: [
            (C {(DQ ($ VSub_Name "$PERL_PATH"))} {(-pe)} 
              {(SQ <"s/\t\"/\t/; s/\\\\//; s/\"$//; tr/:\\t\\n/\\0/">)} {(DQ ($ VSub_At "$@"))}
            )
          ]
          spids: [227]
        )
      spids: [222 226]
    )
    (FuncDef
      name: stderr_contains
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:regexp)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [255]
                )
              ]
              spids: [255]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(test_i18ngrep)} {(DQ ($ VSub_Name "$regexp"))} 
                      {(DQ ($ VSub_Name "$HOME") (/stderr))}
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})]
                  spids: [-1 275]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {
                    (DQ ("didn't find /") ($ VSub_Name "$regexp") ("/ in ") ($ VSub_Name "$HOME") 
                      (/stderr)
                    )
                  }
                )
                (C {(cat)} {(DQ ($ VSub_Name "$HOME") (/stderr))})
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              spids: [283 310]
            )
          ]
          spids: [252]
        )
      spids: [247 251]
    )
    (FuncDef
      name: stderr_empty_on_success
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expect_code)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [323]
                )
              ]
              spids: [323]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {($ VSub_Name "$expect_code")} {(Lit_Other "=")} {(0)})]
                  action: [(C {(test_stderr)} {(DQ )})]
                  spids: [-1 340]
                )
              ]
              else_action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})]
              spids: [349 365]
            )
          ]
          spids: [320]
        )
      spids: [315 319]
    )
    (FuncDef
      name: test_check_ignore
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:args)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [378]
                )
                (assign_pair
                  lhs: (LhsName name:expect_code)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Number 2>
                          suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(0)})
                          spids: [385 389]
                        )
                      )
                    }
                  spids: [383]
                )
                (assign_pair
                  lhs: (LhsName name:global_args)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$3"))}
                  spids: [392]
                )
              ]
              spids: [378]
            )
            (AndOr
              children: [
                (C {(init_vars)})
                (AndOr
                  children: [
                    (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$HOME") (/stdout))} 
                      {(DQ ($ VSub_Name "$HOME") (/stderr))} {(DQ ($ VSub_Name "$HOME") (/cmd))}
                    )
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(git)}
                            {($ VSub_Name "$global_args")}
                            {(check-ignore)}
                            {($ VSub_Name "$quiet_opt")}
                            {($ VSub_Name "$verbose_opt")}
                            {($ VSub_Name "$non_matching_opt")}
                            {($ VSub_Name "$no_index_opt")}
                            {($ VSub_Name "$args")}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {(DQ ($ VSub_Name "$HOME") (/cmd))}
                              spids: [446]
                            )
                          ]
                        )
                        (AndOr
                          children: [
                            (SimpleCommand
                              words: [{(echo)} {(DQ ($ VSub_Name "$expect_code"))}]
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: -1
                                  arg_word: {(DQ ($ VSub_Name "$HOME") (/expected-exit-code))}
                                  spids: [461]
                                )
                              ]
                            )
                            (AndOr
                              children: [
                                (SimpleCommand
                                  words: [
                                    {(test_expect_code)}
                                    {(DQ ($ VSub_Name "$expect_code"))}
                                    {(git)}
                                    {($ VSub_Name "$global_args")}
                                    {(check-ignore)}
                                    {($ VSub_Name "$quiet_opt")}
                                    {($ VSub_Name "$verbose_opt")}
                                    {($ VSub_Name "$non_matching_opt")}
                                    {($ VSub_Name "$no_index_opt")}
                                    {($ VSub_Name "$args")}
                                  ]
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: -1
                                      arg_word: {(DQ ($ VSub_Name "$HOME") (/stdout))}
                                      spids: [496]
                                    )
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 2
                                      arg_word: {(DQ ($ VSub_Name "$HOME") (/stderr))}
                                      spids: [502]
                                    )
                                  ]
                                )
                                (AndOr
                                  children: [
                                    (C {(test_cmp)} {(DQ ($ VSub_Name "$HOME") (/expected-stdout))} 
                                      {(DQ ($ VSub_Name "$HOME") (/stdout))}
                                    )
                                    (C {(stderr_empty_on_success)} {(DQ ($ VSub_Name "$expect_code"))})
                                  ]
                                  op_id: Op_DAmp
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [375]
        )
      spids: [370 374]
    )
    (FuncDef
      name: test_expect_success_multiple
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:prereq) op:Equal rhs:{(SQ )} spids:[609])]
              spids: [609]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {($ VSub_Pound "$#")} {(-eq)} {(5)})]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:prereq)
                          op: Equal
                          rhs: {($ VSub_Number "$1")}
                          spids: [626]
                        )
                      ]
                      spids: [626]
                    )
                    (C {(shift)})
                  ]
                  spids: [-1 623]
                )
              ]
              spids: [-1 633]
            )
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(DQ ($ VSub_Number "$4"))} {(Lit_Other "=")} {(DQ (--index))})]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:no_index_opt)
                          op: Equal
                          rhs: {(SQ )}
                          spids: [654]
                        )
                      ]
                      spids: [654]
                    )
                  ]
                  spids: [-1 651]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:no_index_opt)
                      op: Equal
                      rhs: {($ VSub_Number "$4")}
                      spids: [660]
                    )
                  ]
                  spids: [660]
                )
              ]
              spids: [657 664]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:testname)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [667]
                )
                (assign_pair
                  lhs: (LhsName name:expect_all)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$2"))}
                  spids: [672]
                )
                (assign_pair
                  lhs: (LhsName name:code)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$3"))}
                  spids: [677]
                )
              ]
              spids: [667]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expect_verbose)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} {(DQ ($ VSub_Name "$expect_all"))})
                                  (C {(grep)} {(-v)} {(SQ <"^::\t">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [685 703]
                      )
                    }
                  spids: [684]
                )
              ]
              spids: [684]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expect)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} {(DQ ($ VSub_Name "$expect_verbose"))})
                                  (C {(sed)} {(-e)} {(SQ <"s/.*\t//">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [707 725]
                      )
                    }
                  spids: [706]
                )
              ]
              spids: [706]
            )
            (C {(test_expect_success)} {($ VSub_Name "$prereq")} 
              {
                (DQ ($ VSub_Name "$testname") 
                  (BracedVarSub
                    token: <VSub_Name no_index_opt>
                    suffix_op: 
                      (StringUnary
                        op_id: VTest_ColonPlus
                        arg_word: {(" with ") ($ VSub_Name "$no_index_opt")}
                      )
                    spids: [735 740]
                  )
                )
              } {(SQ <"\n"> <"\t\texpect \"$expect\" &&\n"> <"\t\teval \"$code\"\n"> <"\t">)}
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (C {(test)} 
                      {
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (C {(echo)} {(DQ ($ VSub_Name "$expect_all"))})
                                    (C {(wc)} {(-l)})
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub "$(">
                          spids: [760 774]
                        )
                      } {(Lit_Other "=")} {(1)}
                    )
                  ]
                  action: [
                    (ForEach
                      iter_name: quiet_opt
                      iter_words: [{(SQ <-q>)} {(SQ <--quiet>)}]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:opts)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name no_index_opt>
                                          suffix_op: 
                                            (StringUnary
                                              op_id: VTest_ColonPlus
                                              arg_word: {($ VSub_Name "$no_index_opt") (" ")}
                                            )
                                          spids: [804 809]
                                        ) ($ VSub_Name "$quiet_opt")
                                      )
                                    }
                                  spids: [802]
                                )
                              ]
                              spids: [802]
                            )
                            (C {(test_expect_success)} {($ VSub_Name "$prereq")} 
                              {
                                (DQ ($ VSub_Name "$testname") 
                                  (BracedVarSub
                                    token: <VSub_Name opts>
                                    suffix_op: 
                                      (StringUnary
                                        op_id: VTest_ColonPlus
                                        arg_word: {(" with ") ($ VSub_Name "$opts")}
                                      )
                                    spids: [820 825]
                                  )
                                )
                              } {(DQ ("\n") ("\t\t\texpect '' &&\n") ("\t\t\t") ($ VSub_Name "$code") ("\n") ("\t\t"))}
                            )
                          ]
                          spids: [799 838]
                        )
                      spids: [789 -1]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:quiet_opt)
                          op: Equal
                          rhs: {(SQ )}
                          spids: [841]
                        )
                      ]
                      spids: [841]
                    )
                  ]
                  spids: [-1 781]
                )
              ]
              spids: [-1 844]
            )
            (ForEach
              iter_name: verbose_opt
              iter_words: [{(SQ <-v>)} {(SQ <--verbose>)}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (ForEach
                      iter_name: non_matching_opt
                      iter_words: [{(SQ )} {(SQ <-n>)} {(SQ <--non-matching>)}]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Name "$non_matching_opt"))})]
                                  action: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:my_expect)
                                          op: Equal
                                          rhs: {(DQ ($ VSub_Name "$expect_all"))}
                                          spids: [901]
                                        )
                                      ]
                                      spids: [901]
                                    )
                                  ]
                                  spids: [-1 898]
                                )
                              ]
                              else_action: [
                                (Assignment
                                  keyword: Assign_None
                                  pairs: [
                                    (assign_pair
                                      lhs: (LhsName name:my_expect)
                                      op: Equal
                                      rhs: {(DQ ($ VSub_Name "$expect_verbose"))}
                                      spids: [910]
                                    )
                                  ]
                                  spids: [910]
                                )
                              ]
                              spids: [907 916]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:test_code)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ ("\n") ("\t\t\t\texpect '") ($ VSub_Name "$my_expect") 
                                        ("' &&\n") ("\t\t\t\t") ($ VSub_Name "$code") ("\n") ("\t\t\t")
                                      )
                                    }
                                  spids: [920]
                                )
                              ]
                              spids: [920]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:opts)
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name no_index_opt>
                                          suffix_op: 
                                            (StringUnary
                                              op_id: VTest_ColonPlus
                                              arg_word: {($ VSub_Name "$no_index_opt") (" ")}
                                            )
                                          spids: [935 940]
                                        ) ($ VSub_Name "$verbose_opt") 
                                        (BracedVarSub
                                          token: <VSub_Name non_matching_opt>
                                          suffix_op: 
                                            (StringUnary
                                              op_id: VTest_ColonPlus
                                              arg_word: {(" ") ($ VSub_Name "$non_matching_opt")}
                                            )
                                          spids: [942 947]
                                        )
                                      )
                                    }
                                  spids: [933]
                                )
                              ]
                              spids: [933]
                            )
                            (C {(test_expect_success)} {($ VSub_Name "$prereq")} 
                              {
                                (DQ ($ VSub_Name "$testname") 
                                  (BracedVarSub
                                    token: <VSub_Name opts>
                                    suffix_op: 
                                      (StringUnary
                                        op_id: VTest_ColonPlus
                                        arg_word: {(" with ") ($ VSub_Name "$opts")}
                                      )
                                    spids: [957 962]
                                  )
                                )
                              } {(DQ ($ VSub_Name "$test_code"))}
                            )
                          ]
                          spids: [884 970]
                        )
                      spids: [871 -1]
                    )
                  ]
                  spids: [863 973]
                )
              spids: [853 -1]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:verbose_opt) op:Equal rhs:{(SQ )} spids:[976])]
              spids: [976]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:non_matching_opt)
                  op: Equal
                  rhs: {(SQ )}
                  spids: [979]
                )
              ]
              spids: [979]
            )
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:no_index_opt) op:Equal rhs:{(SQ )} spids:[982])]
              spids: [982]
            )
          ]
          spids: [606]
        )
      spids: [601 605]
    )
    (FuncDef
      name: test_expect_success_multi
      body: 
        (BraceGroup
          children: [(C {(test_expect_success_multiple)} {(DQ ($ VSub_At "$@"))} {(DQ (--index))})]
          spids: [992]
        )
      spids: [987 991]
    )
    (FuncDef
      name: test_expect_success_no_index_multi
      body: 
        (BraceGroup
          children: [(C {(test_expect_success_multiple)} {(DQ ($ VSub_At "$@"))} {(DQ (--no-index))})]
          spids: [1013]
        )
      spids: [1008 1012]
    )
    (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">
        )
      }
    )
    (ForEach
      iter_name: verbose_opt
      iter_words: [{(SQ <-v>)} {(SQ <--verbose>)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (ForEach
              iter_name: quiet_opt
              iter_words: [{(SQ <-q>)} {(SQ <--quiet>)}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(test_expect_success)} 
                      {(DQ ($ VSub_Name "$quiet_opt") (" ") ($ VSub_Name "$verbose_opt"))} 
                      {
                        (DQ ("\n") ("\t\t\texpect '' &&\n") ("\t\t\ttest_check_ignore '") 
                          ($ VSub_Name "$quiet_opt") (" ") ($ VSub_Name "$verbose_opt") (" foo' 128 &&\n") 
                          (
"\t\t\tstderr_contains 'fatal: cannot have both --quiet and --verbose'\n"
                          ) ("\t\t")
                        )
                      }
                    )
                  ]
                  spids: [1209 1233]
                )
              spids: [1199 -1]
            )
          ]
          spids: [1191 1235]
        )
      spids: [1182 -1]
    )
    (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">
        )
      }
    )
    (ForEach
      iter_name: subdir
      iter_words: [{(SQ )} {(SQ <a/>)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name "$subdir"))})]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:where)
                          op: Equal
                          rhs: {(DQ ("at top-level"))}
                          spids: [1401]
                        )
                      ]
                      spids: [1401]
                    )
                  ]
                  spids: [-1 1398]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:where)
                      op: Equal
                      rhs: {(DQ ("in subdir ") ($ VSub_Name "$subdir"))}
                      spids: [1410]
                    )
                  ]
                  spids: [1410]
                )
              ]
              spids: [1407 1417]
            )
            (C {(test_expect_success_multi)} 
              {(DQ ("non-existent file ") ($ VSub_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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_Name "$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")
                )
              }
            )
          ]
          spids: [1384 1859]
        )
      spids: [1376 -1]
    )
    (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 ">
        ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/symlink/foo>) 
        (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 ">
        ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <symlink/foo>) 
        (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 ">
        ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule/one>) 
        (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <" is in submodule ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule>) 
        (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 ">
        ) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <submodule/one>) 
        (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <" is in submodule ">) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) (SQ <a/submodule>) 
        (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"
          >
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: -1
          body: 
            {("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")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [2291]
        )
        (Redir op_id:Redir_Great fd:-1 arg_word:{(stdin)} spids:[2295])
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: -1
          body: 
            {("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")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [2300]
        )
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected-default)} spids:[2304])
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: -1
          body: 
            {
              (DQ (".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) 
                (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_Name "$global_excludes") (":2:!globaltwo\tglobaltwo\n") ($ VSub_Name "$global_excludes") 
                (":2:!globaltwo\ta/globaltwo\n") ($ VSub_Name "$global_excludes") (":2:!globaltwo\ta/b/globaltwo\n") ($ VSub_Name "$global_excludes") 
                (":2:!globaltwo\tb/globaltwo\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [2309]
        )
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected-verbose)} spids:[2312])
      ]
    )
    (SimpleCommand
      words: [{(broken_c_unquote)} {(stdin)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(stdin0)} spids:[2344])]
    )
    (SimpleCommand
      words: [{(broken_c_unquote)} {(expected-default)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-default0)} spids:[2352])]
    )
    (SimpleCommand
      words: [{(broken_c_unquote_verbose)} {(expected-verbose)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-verbose0)} spids:[2360])]
    )
    (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">
        )
      }
    )
    (ForEach
      iter_name: opts
      iter_words: [{(SQ <"--stdin -z">)} {(SQ <"-z --stdin">)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (C {(test_expect_success)} {(DQ ($ VSub_Name "$opts"))} 
              {
                (DQ ("\n") ("\t\texpect_from_stdin <expected-default0 &&\n") 
                  ("\t\ttest_check_ignore '") ($ VSub_Name "$opts") ("' <stdin0\n") ("\t")
                )
              }
            )
            (C {(test_expect_success)} {(DQ ($ VSub_Name "$opts") (" -q"))} 
              {(DQ ("\n") ("\t\texpect ")) 
                (DQ (" &&\n") ("\t\ttest_check_ignore '-q ") ($ VSub_Name "$opts") ("' <stdin0\n") ("\t"))
              }
            )
            (C {(test_expect_success)} {(DQ ($ VSub_Name "$opts") (" -v"))} 
              {
                (DQ ("\n") ("\t\texpect_from_stdin <expected-verbose0 &&\n") 
                  ("\t\ttest_check_ignore '-v ") ($ VSub_Name "$opts") ("' <stdin0\n") ("\t")
                )
              }
            )
          ]
          spids: [2417 2474]
        )
      spids: [2408 -1]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: -1
          body: 
            {("../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")
            }
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [2479]
        )
        (Redir op_id:Redir_Great fd:-1 arg_word:{(stdin)} spids:[2483])
      ]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (HereDoc
          op_id: Redir_DLessDash
          fd: -1
          body: 
            {
              (DQ (".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) 
                (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_Name "$global_excludes") (":2:!globaltwo\t../globaltwo\n") 
                ($ VSub_Name "$global_excludes") (":2:!globaltwo\tglobaltwo\n") ($ VSub_Name "$global_excludes") (":2:!globaltwo\tb/globaltwo\n") 
                ($ VSub_Name "$global_excludes") (":2:!globaltwo\t../b/globaltwo\n") ("::\tc/not-ignored\n")
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [2501]
        )
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expected-all)} spids:[2504])
      ]
    )
    (SimpleCommand
      words: [{(grep)} {(-v)} {(SQ <"^::\t">)} {(expected-all)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-verbose)} spids:[2545])]
    )
    (SimpleCommand
      words: [{(sed)} {(-e)} {(SQ <"s/.*\t//">)} {(expected-verbose)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-default)} spids:[2558])]
    )
    (SimpleCommand
      words: [{(broken_c_unquote)} {(stdin)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(stdin0)} spids:[2566])]
    )
    (SimpleCommand
      words: [{(broken_c_unquote)} {(expected-default)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-default0)} spids:[2574])]
    )
    (SimpleCommand
      words: [{(broken_c_unquote_verbose)} {(expected-verbose)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(expected-verbose0)} spids:[2582])]
    )
    (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">
        )
      }
    )
    (ForEach
      iter_name: opts
      iter_words: [{(SQ <"--stdin -z">)} {(SQ <"-z --stdin">)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (C {(test_expect_success)} {(DQ ($ VSub_Name "$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_Name "$opts")) (SQ <"\" <../stdin0\n"> <"\t\t)\n"> <"\t">)
              }
            )
            (C {(test_expect_success)} {(DQ ($ VSub_Name "$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_Name "$opts")) (SQ <" -v\" <../stdin0\n"> <"\t\t)\n"> <"\t">)
              }
            )
          ]
          spids: [2648 2699]
        )
      spids: [2639 -1]
    )
    (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)})
  ]
)