3 test_description='Test merge without common ancestors'
6 # This scenario is based on a real-world repository of Shawn Pearce.
14 GIT_COMMITTER_DATE="2006-12-12 23:28:00 +0100"
15 export GIT_COMMITTER_DATE
17 test_expect_success "setup tests" '
20 GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
22 git checkout -b A master &&
24 GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
26 git checkout -b B master &&
28 GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
30 git checkout -b D A &&
31 git-rev-parse B > .git/MERGE_HEAD &&
33 git update-index a1 &&
34 GIT_AUTHOR_DATE="2006-12-12 23:00:03" git commit -m D &&
36 git symbolic-ref HEAD refs/heads/other &&
38 GIT_AUTHOR_DATE="2006-12-12 23:00:04" git commit -m 2 a1 &&
42 GIT_AUTHOR_DATE="2006-12-12 23:00:05" git commit -m C a1 &&
44 git checkout -b E C &&
45 git-rev-parse B > .git/MERGE_HEAD &&
47 git update-index a1 &&
48 GIT_AUTHOR_DATE="2006-12-12 23:00:06" git commit -m E &&
50 git checkout -b G E &&
51 git-rev-parse A > .git/MERGE_HEAD &&
53 git update-index a1 &&
54 GIT_AUTHOR_DATE="2006-12-12 23:00:07" git commit -m G &&
56 git checkout -b F D &&
57 git-rev-parse C > .git/MERGE_HEAD &&
59 git update-index a1 &&
60 GIT_AUTHOR_DATE="2006-12-12 23:00:08" git commit -m F
63 test_expect_failure "combined merge conflicts" "git merge -m final G"
73 test_expect_success "result contains a conflict" "git diff expect a1"
75 git ls-files --stage > out
77 100644 da056ce14a2241509897fa68bb2b3b6e6194ef9e 1 a1
78 100644 cf84443e49e1b366fac938711ddf4be2d4d1d9e9 2 a1
79 100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1
82 test_expect_success "virtual trees were processed" "git diff expect out"