WIP: grep --substitute <substitution> <pattern>
[git/dscho.git] / t / t7404-submodule-tree.sh
blobe8f8a301c5b837e19261ebfd6efff4202b21369a
1 #!/bin/sh
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.
11 . ./test-lib.sh
13 test_expect_success setup '
15 mkdir sub &&
16 echo original > sub/file &&
17 git add sub/file &&
18 test_tick &&
19 git commit -m initial &&
20 echo newer > sub/file &&
21 test_tick &&
22 git commit -m newer sub/file &&
23 git checkout -b side HEAD^ &&
24 git rm sub/file &&
25 mkdir sub &&
26 (cd sub &&
27 git init &&
28 echo file > file &&
29 git add file &&
30 test_tick &&
31 git commit -m submodule) &&
32 git add sub &&
33 test_tick &&
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' '
47 git reset --hard &&
48 mv sub submodule &&
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' '
64 git reset --hard &&
65 echo another > file &&
66 git add file &&
67 test_tick &&
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' '
76 git reset --hard &&
77 git rm file &&
78 git mv sub file &&
79 test_tick &&
80 git commit -m side2 &&
81 git checkout -b side3 HEAD^ &&
82 echo yet another > file2 &&
83 git add file2 &&
84 test_tick &&
85 git commit -m side3 &&
86 git merge side2
90 test_done