(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'checkout must not overwrite an untracked objects'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\n'> <'\tmkdir -p a/b/c &&\n'> <'\t>a/b/c/d &&\n'> <'\tgit add -A &&\n'> <'\tgit commit -m base &&\n'> <'\tgit tag start\n'> ) } ) (C {(test_expect_success)} {(SQ <'create a commit where dir a/b changed to file'>)} { (SQ <'\n'> <'\n'> <'\tgit checkout -b file &&\n'> <'\trm -rf a/b &&\n'> <'\t>a/b &&\n'> <'\tgit add -A &&\n'> <'\tgit commit -m "dir to file"\n'> ) } ) (C {(test_expect_success)} {(SQ <'checkout commit with dir must not remove untracked a/b'>)} { (SQ <'\n'> <'\n'> <'\tgit rm --cached a/b &&\n'> <'\tgit commit -m "un-track the file" &&\n'> <'\ttest_must_fail git checkout start &&\n'> <'\ttest -f a/b\n'> ) } ) (C {(test_expect_success)} {(SQ <'create a commit where dir a/b changed to symlink'>)} { (SQ <'\n'> <'\n'> <'\trm -rf a/b &&\t# cleanup if previous test failed\n'> <'\tgit checkout -f -b symlink start &&\n'> <'\trm -rf a/b &&\n'> <'\tgit add -A &&\n'> <'\ttest_ln_s_add foo a/b &&\n'> <'\tgit commit -m "dir to symlink"\n'> ) } ) (C {(test_expect_success)} {(SQ <'checkout commit with dir must not remove untracked a/b'>)} { (SQ <'\n'> <'\n'> <'\tgit rm --cached a/b &&\n'> <'\tgit commit -m "un-track the symlink" &&\n'> <'\ttest_must_fail git checkout start\n'> ) } ) (C {(test_expect_success)} {(SYMLINKS)} {(SQ <'the symlink remained'>)} {(SQ <'\n'> <'\n'> <'\ttest -h a/b\n'>)} ) (C {(test_done)}) ] )