Code

grep doc: add --break / --heading / -W to synopsis
[git.git] / t / t3504-cherry-pick-rerere.sh
1 #!/bin/sh
3 test_description='cherry-pick should rerere for conflicts'
5 . ./test-lib.sh
7 test_expect_success setup '
8         echo foo >foo &&
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^ &&
14         echo foo-dev >foo &&
15         git add foo && test_tick && git commit -q -m 3 &&
16         git config rerere.enabled true
17 '
19 test_expect_success 'conflicting merge' '
20         test_must_fail git merge master
21 '
23 test_expect_success 'fixup' '
24         echo foo-dev >foo &&
25         git add foo && test_tick && git commit -q -m 4 &&
26         git reset --hard HEAD^ &&
27         echo foo-dev >expect
28 '
30 test_expect_success 'cherry-pick conflict' '
31         test_must_fail git cherry-pick master &&
32         test_cmp expect foo
33 '
35 test_expect_success 'reconfigure' '
36         git config rerere.enabled false &&
37         git reset --hard
38 '
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
43 '
45 test_done