3 test_description
='recursive merge diff3 style conflict markers'
15 # L1 and R1 both have a file named 'content' but have no common history
18 test_expect_success
'setup no merge base' '
19 test_create_repo no_merge_base &&
24 test_commit A content A &&
26 git checkout --orphan R &&
27 test_commit B content B
31 test_expect_success
'check no merge base' '
37 test_must_fail git -c merge.conflictstyle=diff3 merge --allow-unrelated-histories -s recursive R^0 &&
39 grep "|||||| empty tree" content
51 # L1 and R1 have modified the same file ('content') in conflicting ways
54 test_expect_success
'setup unique merge base' '
55 test_create_repo unique_merge_base &&
57 cd unique_merge_base &&
59 test_commit base content "1
70 test_commit L content "1
79 test_commit R renamed "1
88 test_expect_success
'check unique merge base' '
90 cd unique_merge_base &&
93 MASTER=$(git rev-parse --short master) &&
95 test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
97 grep "|||||| $MASTER:content" renamed
109 # commits L1 and R1 have modified the same file in non-conflicting ways
110 # X1 is an auto-generated merge-base used when merging L1 and R1
111 # commits L2 and R2 are merges of R1 and L1 into L1 and R1, respectively
112 # commits L3 and R3 both modify 'content' in conflicting ways
115 test_expect_success
'setup multiple merge bases' '
116 test_create_repo multiple_merge_bases &&
118 cd multiple_merge_bases &&
120 test_commit initial content "1
131 test_commit L1 content "0
140 test_commit R1 content "1
157 test_commit L3 content "0
168 test_commit R3 renamed "0
177 test_expect_success
'check multiple merge bases' '
179 cd multiple_merge_bases &&
183 test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
185 grep "|||||| merged common ancestors:content" renamed
189 test_expect_success
'rebase --merge describes parent of commit being picked' '
190 test_create_repo rebase &&
193 test_commit base file &&
194 test_commit master file &&
195 git checkout -b side HEAD^ &&
196 test_commit side file &&
197 test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master &&
198 grep "||||||| parent of" file
202 test_expect_success
'rebase --apply describes fake ancestor base' '
205 git rebase --abort &&
206 test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master &&
207 grep "||||||| constructed merge base" file