(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <'git ls-files --others --exclude\n'> <'\n'> 
                <'This test runs git ls-files --others and tests --exclude patterns.\n'>
              )
            }
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(rm)} {(-fr)} {(one)} {(three)})
    (ForEach
      iter_name: dir
      iter_words: [{(.)} {(one)} {(one/two)} {(three)}]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} {($ VSub_Name '$dir')})
                (ForEach
                  iter_name: i
                  iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)}]
                  do_arg_iter: False
                  body: 
                    (DoGroup
                      children: [
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: -1
                              arg_word: {($ VSub_Name '$dir') (/a.) ($ VSub_Name '$i')}
                              spids: [86]
                            )
                          ]
                        )
                      ]
                      spids: [83 92]
                    )
                  spids: [65 -1]
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [48 94]
        )
      spids: [39 -1]
    )
    (SimpleCommand
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(DQ ('#ignore1'))} spids:[96])]
    )
    (SimpleCommand
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(DQ ('#ignore2'))} spids:[101])]
    )
    (SimpleCommand
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(DQ ('#hidden'))} spids:[106])]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[114])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: 
            {
              (DQ ('a.2\n') ('a.4\n') ('a.5\n') ('a.8\n') ('one/a.3\n') ('one/a.4\n') ('one/a.5\n') 
                ('one/a.7\n') ('one/two/a.2\n') ('one/two/a.3\n') ('one/two/a.5\n') ('one/two/a.7\n') ('one/two/a.8\n') ('three/a.2\n') 
                ('three/a.3\n') ('three/a.4\n') ('three/a.5\n') ('three/a.8\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [117]
        )
      ]
    )
    (SimpleCommand
      words: [
        {(echo)}
        {
          (SQ <'.gitignore\n'> <'\\#ignore1\n'> <'\\#ignore2*\n'> <'\\#hid*n\n'> <'output\n'> <'expect\n'> 
            <'.gitignore\n'> <'*.7\n'> <'!*.8'>
          )
        }
      ]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(.git/ignore)} spids:[154])]
    )
    (SimpleCommand
      words: [{(echo)} {(SQ <'*.1\n'> <'/*.3\n'> <'!*.6'>)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(.gitignore)} spids:[166])]
    )
    (SimpleCommand
      words: [{(echo)} {(SQ <'*.2\n'> <'two/*.4\n'> <'!*.7\n'> <'*.8'>)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(one/.gitignore)} spids:[178])]
    )
    (SimpleCommand
      words: [{(echo)} {(SQ <'!*.2\n'> <'!*.8'>)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(one/two/.gitignore)} spids:[188])]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:allignores)
          op: Equal
          rhs: {(SQ <'.gitignore one/.gitignore one/two/.gitignore'>)}
          spids: [192]
        )
      ]
      spids: [192]
    )
    (C {(test_expect_success)} {(SQ <'git ls-files --others with various exclude options.'>)} 
      {
        (SQ <'git ls-files --others \\\n'> <'       --exclude=\\*.6 \\\n'> 
          <'       --exclude-per-directory=.gitignore \\\n'> <'       --exclude-from=.git/ignore \\\n'> <'       >output &&\n'> <'     test_cmp expect output'>
        )
      }
    )
    (SimpleCommand
      words: [{(printf)} {(SQ <'*.1\\r\\n/*.3\\r\\n!*.6\\r\\n'>)}]
      redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(.gitignore)} spids:[227])]
    )
    (C {(test_expect_success)} {(SQ <'git ls-files --others with \\r\\n line endings.'>)} 
      {
        (SQ <'git ls-files --others \\\n'> <'       --exclude=\\*.6 \\\n'> 
          <'       --exclude-per-directory=.gitignore \\\n'> <'       --exclude-from=.git/ignore \\\n'> <'       >output &&\n'> <'     test_cmp expect output'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'setup skip-worktree gitignore'>)} 
      {
        (SQ <'\n'> <'\tgit add $allignores &&\n'> 
          <'\tgit update-index --skip-worktree $allignores &&\n'> <'\trm $allignores\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'git ls-files --others with various exclude options.'>)} 
      {
        (SQ <'git ls-files --others \\\n'> <'       --exclude=\\*.6 \\\n'> 
          <'       --exclude-per-directory=.gitignore \\\n'> <'       --exclude-from=.git/ignore \\\n'> <'       >output &&\n'> <'     test_cmp expect output'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'restore gitignore'>)} 
      {
        (SQ <'\n'> <'\tgit checkout --ignore-skip-worktree-bits $allignores &&\n'> 
          <'\trm .git/index\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(excludes-file)} spids:[300])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {('*.[1-8]\n') ('e*\n') ('\\#*\n')}
          do_expansion: False
          here_end: EOF
          was_filled: True
          spids: [304]
        )
      ]
    )
    (C {(git)} {(config)} {(core.excludesFile)} {(excludes-file)})
    (Pipeline
      children: [
        (C {(git)} {(-c)} {(status.displayCommentPrefix) (Lit_Other '=') (true)} {(status)})
        (SimpleCommand
          words: [{(grep)} {(DQ ('^#\t'))}]
          redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[336])]
        )
      ]
      negated: False
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[343])
        (HereDoc
          op_id: Redir_DLess
          fd: -1
          body: {(DQ ('#\t.gitignore\n') ('#\ta.6\n') ('#\tone/\n') ('#\toutput\n') ('#\tthree/\n'))}
          do_expansion: True
          here_end: EOF
          was_filled: True
          spids: [347]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'git status honors core.excludesfile'>)} 
      {(SQ <'test_cmp expect output'>)}
    )
    (C {(test_expect_success)} {(SQ <'trailing slash in exclude allows directory match(1)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude=one/ >output &&\n'> 
          <'\tif grep "^one/" output\n'> <'\tthen\n'> <'\t\techo Ooops\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\t: happy\n'> <'\tfi\n'> <'\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'trailing slash in exclude allows directory match (2)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude=one/two/ >output &&\n'> 
          <'\tif grep "^one/two/" output\n'> <'\tthen\n'> <'\t\techo Ooops\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\t: happy\n'> <'\tfi\n'> <'\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'trailing slash in exclude forces directory match (1)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\t>two &&\n'> <'\tgit ls-files --others --exclude=two/ >output &&\n'> 
          <'\tgrep "^two" output\n'> <'\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'trailing slash in exclude forces directory match (2)'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude=one/a.1/ >output &&\n'> 
          <'\tgrep "^one/a.1" output\n'> <'\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'negated exclude matches can override previous ones'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude="a.*" --exclude="!a.1" >output &&\n'> 
          <'\tgrep "^a.1" output\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'excluded directory overrides content patterns'>)} 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude="one" --exclude="!one/a.1" >output &&\n'> 
          <'\tif grep "^one/a.1" output\n'> <'\tthen\n'> <'\t\tfalse\n'> <'\tfi\n'>
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <'negated directory doesn'>) (EscapedLiteralPart token:<Lit_EscapedChar "\\'">) 
        (SQ <'t affect content patterns'>)
      } 
      {
        (SQ <'\n'> <'\n'> <'\tgit ls-files --others --exclude="!one" --exclude="one/a.1" >output &&\n'> 
          <'\tif grep "^one/a.1" output\n'> <'\tthen\n'> <'\t\tfalse\n'> <'\tfi\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'subdirectory ignore (setup)'>)} 
      {
        (SQ <'\n'> <'\tmkdir -p top/l1/l2 &&\n'> <'\t(\n'> <'\t\tcd top &&\n'> <'\t\tgit init &&\n'> 
          <'\t\techo /.gitignore >.gitignore &&\n'> <'\t\techo l1 >>.gitignore &&\n'> <'\t\techo l2 >l1/.gitignore &&\n'> <'\t\t>l1/l2/l1\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'subdirectory ignore (toplevel)'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top &&\n'> <'\t\tgit ls-files -o --exclude-standard\n'> 
          <'\t) >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'subdirectory ignore (l1/l2)'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top/l1/l2 &&\n'> <'\t\tgit ls-files -o --exclude-standard\n'> 
          <'\t) >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'subdirectory ignore (l1)'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top/l1 &&\n'> <'\t\tgit ls-files -o --exclude-standard\n'> 
          <'\t) >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'show/hide empty ignored directory (setup)'>)} 
      {(SQ <'\n'> <'\trm top/l1/l2/l1 &&\n'> <'\trm top/l1/.gitignore\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'show empty ignored directory with --directory'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top &&\n'> <'\t\tgit ls-files -o -i --exclude l1 --directory\n'> 
          <'\t) >actual &&\n'> <'\techo l1/ >expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'hide empty ignored directory with --no-empty-directory'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top &&\n'> 
          <'\t\tgit ls-files -o -i --exclude l1 --directory --no-empty-directory\n'> <'\t) >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'show/hide empty ignored sub-directory (setup)'>)} 
      {
        (SQ <'\n'> <'\t> top/l1/tracked &&\n'> <'\t(\n'> <'\t\tcd top &&\n'> 
          <'\t\tgit add -f l1/tracked\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'show empty ignored sub-directory with --directory'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top &&\n'> <'\t\tgit ls-files -o -i --exclude l1 --directory\n'> 
          <'\t) >actual &&\n'> <'\techo l1/l2/ >expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'hide empty ignored sub-directory with --no-empty-directory'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tcd top &&\n'> 
          <'\t\tgit ls-files -o -i --exclude l1 --directory --no-empty-directory\n'> <'\t) >actual &&\n'> <'\t>expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'pattern matches prefix completely'>)} 
      {
        (SQ <'\n'> <'\t: >expect &&\n'> 
          <'\tgit ls-files -i -o --exclude "/three/a.3[abc]" >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'ls-files with "**" patterns'>)} 
      {
        (SQ <'\n'> <'\tcat <<\\EOF >expect &&\n'> <'a.1\n'> <'one/a.1\n'> <'one/two/a.1\n'> 
          <'three/a.1\n'> <'EOF\n'> <'\tgit ls-files -o -i --exclude "**/a.1" >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'ls-files with "**" patterns and no slashes'>)} 
      {
        (SQ <'\n'> <'\t: >expect &&\n'> <'\tgit ls-files -o -i --exclude "one**a.1" >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)