3 test_description='cherry-pick should rerere for conflicts'
7 test_expect_success setup '
9 git add foo && test_tick && git commit -q -m 1 &&
10 echo foo-master >foo &&
11 git add foo && test_tick && git commit -q -m 2 &&
13 git checkout -b dev HEAD^ &&
15 git add foo && test_tick && git commit -q -m 3 &&
16 git config rerere.enabled true
19 test_expect_success 'conflicting merge' '
20 test_must_fail git merge master
23 test_expect_success 'fixup' '
25 git add foo && test_tick && git commit -q -m 4 &&
26 git reset --hard HEAD^ &&
30 test_expect_success 'cherry-pick conflict' '
31 test_must_fail git cherry-pick master &&
35 test_expect_success 'reconfigure' '
36 git config rerere.enabled false &&
40 test_expect_success 'cherry-pick conflict without rerere' '
41 test_must_fail git cherry-pick master &&
42 test_must_fail test_cmp expect foo
45 test_expect_success 'cherry-pick --rerere-autoupdate' '
46 test_when_finished "rm -rf rerere" &&
49 test_config rerere.enabled true &&
50 echo one > content-a && git add content-a &&
51 echo one > content-b && git add content-b &&
53 git checkout -b conflict master &&
54 echo conflict-a > content-a &&
55 git commit -a -m conflict-a &&
56 echo conflict-b > content-b &&
57 git commit -a -m conflict-b &&
58 git checkout master &&
59 echo two > content-a &&
60 echo two > content-b &&
61 git commit -a -m two &&
62 git checkout -b test &&
63 test_must_fail git cherry-pick master..conflict &&
64 echo resolved-a > content-a &&
66 test_must_fail git cherry-pick --continue &&
67 echo resolved-b > content-b &&
69 git cherry-pick --continue &&
70 git reset --hard master &&
71 git log --oneline --all --decorate --graph &&
72 test_must_fail git cherry-pick --rerere-autoupdate master..conflict &&
73 git log --oneline --all --decorate --graph &&
74 echo resolved-a > expected &&
75 test_cmp expected content-a &&
76 test_must_fail git cherry-pick --continue &&
77 echo resolved-b > expected &&
78 test_cmp expected content-b &&
79 git cherry-pick --continue