]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t7603-merge-reduce-heads.sh
3 test_description
='git merge
5 Testing octopus merge when reducing parents to independent branches.'
14 # So 1, 2, 3 and 5 should be kept, 4 should be avoided.
16 test_expect_success
'setup' '
25 git reset --hard c0 &&
30 git reset --hard c0 &&
35 git reset --hard c0 &&
46 test_expect_success
'merge c1 with c2, c3, c4, c5' '
47 git reset --hard c1 &&
48 git merge c2 c3 c4 c5 &&
49 test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
50 test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
51 test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
52 test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
53 test "$(git rev-parse c5)" = "$(git rev-parse HEAD^4)" &&
54 git diff --exit-code &&
63 test_expect_success
'setup' '
81 test_expect_success
'merge E and I' '
86 test_expect_success
'verify merge result' '
87 test $(git rev-parse HEAD^1) = $(git rev-parse E) &&
88 test $(git rev-parse HEAD^2) = $(git rev-parse I)
91 test_expect_success
'add conflicts' '
104 test_expect_success
'merge E2 and I2, causing a conflict and resolve it' '
105 git reset --hard A &&
106 test_must_fail git merge E2 I2 &&
109 git commit -m "resolve conflict"
112 test_expect_success
'verify merge result' '
113 test $(git rev-parse HEAD^1) = $(git rev-parse E2) &&
114 test $(git rev-parse HEAD^2) = $(git rev-parse I2)