(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.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<expected>})
        (redir.HereDoc
          op: <Id.Redir_DLess '<<'>
          fd: -1
          here_begin: {<EOF>}
          here_end_span_id: 58
          stdin_parts: [<"add 'anothersub/foo'\n">]
        )
      ]
    )
    (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.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<expected>})
        (redir.HereDoc
          op: <Id.Redir_DLess '<<'>
          fd: -1
          here_begin: {<EOF>}
          here_end_span_id: 95
          stdin_parts: [<"add 'sub/foo'\n">]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test_have_prereq>} {<Id.KW_Bang '!'> <MINGW>})
                (command.Simple
                  words: [{<mkdir>} {(DQ <':'>)}]
                  redirects: [(redir.Redir op:<Id.Redir_Great '2>'> fd:2 arg_word:{</dev/null>})]
                )
              ]
            )
          ]
          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>})
  ]
)