(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'Test merge with directory/file conflicts'>)} spids: [13] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'prepare repository'>)} { (SQ <'\n'> <'\techo Hello >init &&\n'> <'\tgit add init &&\n'> <'\tgit commit -m initial &&\n'> <'\n'> <'\tgit branch B &&\n'> <'\tmkdir dir &&\n'> <'\techo foo >dir/foo &&\n'> <'\tgit add dir/foo &&\n'> <'\tgit commit -m "File: dir/foo" &&\n'> <'\n'> <'\tgit checkout B &&\n'> <'\techo file dir >dir &&\n'> <'\tgit add dir &&\n'> <'\tgit commit -m "File: dir"\n'> ) } ) (C {<test_expect_success>} {(SQ <'Merge with d/f conflicts'>)} {(SQ <'\n'> <'\ttest_expect_code 1 git merge -m "merge msg" master\n'>)} ) (C {<test_expect_success>} {(SQ <'F/D conflict'>)} { (SQ <'\n'> <'\tgit reset --hard &&\n'> <'\tgit checkout master &&\n'> <'\trm .git/index &&\n'> <'\n'> <'\tmkdir before &&\n'> <'\techo FILE >before/one &&\n'> <'\techo FILE >after &&\n'> <'\tgit add . &&\n'> <'\tgit commit -m first &&\n'> <'\n'> <'\trm -f after &&\n'> <'\tgit mv before after &&\n'> <'\tgit commit -m move &&\n'> <'\n'> <'\tgit checkout -b para HEAD^ &&\n'> <'\techo COMPLETELY ANOTHER FILE >another &&\n'> <'\tgit add . &&\n'> <'\tgit commit -m para &&\n'> <'\n'> <'\tgit merge master\n'> ) } ) (C {<test_expect_success>} {(SQ <'setup modify/delete + directory/file conflict'>)} { (SQ <'\n'> <'\tgit checkout --orphan modify &&\n'> <'\tgit rm -rf . &&\n'> <'\tgit clean -fdqx &&\n'> <'\n'> <'\tprintf "a\\nb\\nc\\nd\\ne\\nf\\ng\\nh\\n" >letters &&\n'> <'\tgit add letters &&\n'> <'\tgit commit -m initial &&\n'> <'\n'> <'\t# Throw in letters.txt for sorting order fun\n'> <'\t# ("letters.txt" sorts between "letters" and "letters/file")\n'> <'\techo i >>letters &&\n'> <'\techo "version 2" >letters.txt &&\n'> <'\tgit add letters letters.txt &&\n'> <'\tgit commit -m modified &&\n'> <'\n'> <'\tgit checkout -b delete HEAD^ &&\n'> <'\tgit rm letters &&\n'> <'\tmkdir letters &&\n'> <'\t>letters/file &&\n'> <'\techo "version 1" >letters.txt &&\n'> <'\tgit add letters letters.txt &&\n'> <'\tgit commit -m deleted\n'> ) } ) (C {<test_expect_success>} {(SQ <'modify/delete + directory/file conflict'>)} { (SQ <'\n'> <'\tgit checkout delete^0 &&\n'> <'\ttest_must_fail git merge modify &&\n'> <'\n'> <'\ttest 5 -eq $(git ls-files -s | wc -l) &&\n'> <'\ttest 4 -eq $(git ls-files -u | wc -l) &&\n'> <'\ttest 1 -eq $(git ls-files -o | wc -l) &&\n'> <'\n'> <'\ttest -f letters/file &&\n'> <'\ttest -f letters.txt &&\n'> <'\ttest -f letters~modify\n'> ) } ) (C {<test_expect_success>} {(SQ <'modify/delete + directory/file conflict; other way'>)} { (SQ <'\n'> <'\t# Yes, we really need the double reset since "letters" appears as\n'> <'\t# both a file and a directory.\n'> <'\tgit reset --hard &&\n'> <'\tgit reset --hard &&\n'> <'\tgit clean -f &&\n'> <'\tgit checkout modify^0 &&\n'> <'\n'> <'\ttest_must_fail git merge delete &&\n'> <'\n'> <'\ttest 5 -eq $(git ls-files -s | wc -l) &&\n'> <'\ttest 4 -eq $(git ls-files -u | wc -l) &&\n'> <'\ttest 1 -eq $(git ls-files -o | wc -l) &&\n'> <'\n'> <'\ttest -f letters/file &&\n'> <'\ttest -f letters.txt &&\n'> <'\ttest -f letters~HEAD\n'> ) } ) (C {<test_done>}) ] )