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_success
'merging with tree/submodule conflict fails' '
40 test_must_fail git merge master &&
41 test -f .git/MERGE_MSG
45 test_expect_success
'the other way round' '
49 git checkout -f master &&
50 test_must_fail git merge side &&
51 test -f .git/MERGE_MSG
55 test_expect_failure
'checkout from submodule/directory conflict' '
57 git checkout -f -b side2 HEAD^ &&
58 test -z "$(git ls-files --unmerged)"
62 test_expect_success
'merge submodule without changing the directory' '
65 echo another > file &&
68 git commit -m side2 &&
69 test_must_fail git merge side &&
70 test -f .git/MERGE_MSG
74 test_expect_failure
'file/submodule conflict' '
80 git commit -m side2 &&
81 git checkout -b side3 HEAD^ &&
82 echo yet another > file2 &&
85 git commit -m side3 &&