(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'magic pathspec tests using git-add'>)} spids: [12] ) ] spids: [12] ) (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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 66 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.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expected)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 103 stdin_parts: [("add 'sub/foo'\n")] ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_have_prereq)} {(KW_Bang '!') (MINGW)}) (command.SimpleCommand words: [{(mkdir)} {(DQ (':'))}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) ] ) ] action: [(C {(test_set_prereq)} {(COLON_DIR)})] spids: [16777215 123] ) ] spids: [16777215 130] ) (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)}) ] )