3 # Copyright (c) 2008 Johannes E. Schindelin
6 test_description
='git submodule/tree conflict
8 Tests what happens when a subdirectory becomes a submodule all of a sudden.
13 test_expect_success setup
'
16 echo original > sub/file &&
19 git commit -m initial &&
20 echo newer > sub/file &&
22 git commit -m newer sub/file &&
23 git checkout -b side HEAD^ &&
31 git commit -m submodule) &&
34 git commit -m with-submodule
38 test_expect_failure
'merging with tree/submodule conflict fails' '
40 test_must_fail git merge master &&
41 test -f .git/MERGE_MSG
45 test_expect_failure
'the other way round' '
49 git checkout -f master &&
50 test_must_fail git merge side &&
51 test -f .git/MERGE_MSG
55 # This will be only a failure when the previous tests succeed
56 test_expect_failure
'checkout from submodule/directory conflict' '
58 git checkout -f -b side2 HEAD^ &&
59 test -z "$(git ls-files --unmerged)"
63 test_expect_failure
'merge submodule without changing the directory' '
66 echo another > file &&
69 git commit -m side2 &&
70 test_must_fail git merge side &&
71 test -f .git/MERGE_MSG
75 test_expect_failure
'file/submodule conflict' '
81 git commit -m side2 &&
82 git checkout -b side3 HEAD^ &&
83 echo yet another > file2 &&
86 git commit -m side3 &&