Code

Update jk/maint-strbuf-missing-init to builtin/ rename
[git.git] / t / t7405-submodule-merge.sh
1 #!/bin/sh
3 test_description='merging with submodules'
5 . ./test-lib.sh
7 #
8 # history
9 #
10 #        a --- c
11 #      /   \ /
12 # root      X
13 #      \   / \
14 #        b --- d
15 #
17 test_expect_success setup '
19         mkdir sub &&
20         (cd sub &&
21          git init &&
22          echo original > file &&
23          git add file &&
24          test_tick &&
25          git commit -m sub-root) &&
26         git add sub &&
27         test_tick &&
28         git commit -m root &&
30         git checkout -b a master &&
31         (cd sub &&
32          echo A > file &&
33          git add file &&
34          test_tick &&
35          git commit -m sub-a) &&
36         git add sub &&
37         test_tick &&
38         git commit -m a &&
40         git checkout -b b master &&
41         (cd sub &&
42          echo B > file &&
43          git add file &&
44          test_tick &&
45          git commit -m sub-b) &&
46         git add sub &&
47         test_tick &&
48         git commit -m b
50         git checkout -b c a &&
51         git merge -s ours b &&
53         git checkout -b d b &&
54         git merge -s ours a
55 '
57 test_expect_success 'merging with modify/modify conflict' '
59         git checkout -b test1 a &&
60         test_must_fail git merge b &&
61         test -f .git/MERGE_MSG &&
62         git diff &&
63         test -n "$(git ls-files -u)"
64 '
66 test_expect_success 'merging with a modify/modify conflict between merge bases' '
68         git reset --hard HEAD &&
69         git checkout -b test2 c &&
70         git merge d
72 '
74 test_done