(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'magic pathspec tests using git-add'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {(SQ <setup>)} 
      {(SQ <'\n'> <'\tmkdir sub anothersub &&\n'> <'\t: >sub/foo &&\n'> <'\t: >anothersub/foo\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'add :/'>)} 
      {
        (DQ <'\n'> <'\tcat >expected <<-EOF &&\n'> <'\tadd \'anothersub/foo\'\n'> 
          <'\tadd \'expected\'\n'> <'\tadd \'sub/actual\'\n'> <'\tadd \'sub/foo\'\n'> <'\tEOF\n'> 
          <'\t(cd sub && git add -n :/ >actual) &&\n'> <'\ttest_cmp expected sub/actual\n'>
        )
      }
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_span_id: 58
              stdin_parts: [<'add \'anothersub/foo\'\n'>]
            )
        )
      ]
      do_fork: T
    )
    (C {<test_expect_success>} {(SQ <'add :/anothersub'>)} 
      {
        (SQ <'\n'> <'\t(cd sub && git add -n :/anothersub >actual) &&\n'> 
          <'\ttest_cmp expected sub/actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'add :/non-existent'>)} 
      {(SQ <'\n'> <'\t(cd sub && test_must_fail git add -n :/non-existent)\n'>)}
    )
    (command.Simple
      words: [{<cat>}]
      redirects: [
        (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expected>})
        (redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_span_id: 95
              stdin_parts: [<'add \'sub/foo\'\n'>]
            )
        )
      ]
      do_fork: T
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (C {<test_have_prereq>} {<Id.KW_Bang '!'> <MINGW>})
                    (command.Simple
                      words: [{<mkdir>} {(DQ <':'>)}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Great '2>'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                )
              ]
            )
          action: [(C {<test_set_prereq>} {<COLON_DIR>})]
          spids: [97 115]
        )
      ]
    )
    (C {<test_expect_success>} {<COLON_DIR>} {(SQ <'a file with the same (long) magic name exists'>)} 
      {
        (SQ <'\n'> <'\t: >":(icase)ha" &&\n'> <'\ttest_must_fail git add -n ":(icase)ha" &&\n'> 
          <'\tgit add -n "./:(icase)ha"\n'>
        )
      }
    )
    (C {<test_expect_success>} {<COLON_DIR>} {(SQ <'a file with the same (short) magic name exists'>)} 
      {
        (SQ <'\n'> <'\t: >":/bar" &&\n'> <'\ttest_must_fail git add -n :/bar &&\n'> 
          <'\tgit add -n "./:/bar"\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)