(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"magic pathspec tests using git-add">)} spids: [4] ) ] 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") ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[50]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ("add 'anothersub/foo'\n"))} do_expansion: True here_end: EOF was_filled: True spids: [53] ) ] ) (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">)} ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expected)} spids:[85]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ("add 'sub/foo'\n"))} do_expansion: True here_end: EOF was_filled: True spids: [88] ) ] ) (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(test_have_prereq)} {(KW_Bang "!") (MINGW)}) (SimpleCommand words: [{(mkdir)} {(DQ (":"))}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[108])] ) ] op_id: Op_DAmp ) ] action: [(C {(test_set_prereq)} {(COLON_DIR)})] spids: [-1 111] ) ] spids: [-1 118] ) (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)}) ] )