t3504: use test_commit
[git] / t / t3504-cherry-pick-rerere.sh
1 #!/bin/sh
2
3 test_description='cherry-pick should rerere for conflicts'
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8         test_commit foo &&
9         test_commit foo-master foo &&
10
11         git checkout -b dev foo &&
12         test_commit foo-dev foo &&
13         git config rerere.enabled true
14 '
15
16 test_expect_success 'conflicting merge' '
17         test_must_fail git merge master
18 '
19
20 test_expect_success 'fixup' '
21         echo foo-resolved >foo &&
22         git commit -am resolved &&
23         cp foo expect &&
24         git reset --hard HEAD^
25 '
26
27 test_expect_success 'cherry-pick conflict' '
28         test_must_fail git cherry-pick master &&
29         test_cmp expect foo
30 '
31
32 test_expect_success 'reconfigure' '
33         git config rerere.enabled false &&
34         git reset --hard
35 '
36
37 test_expect_success 'cherry-pick conflict without rerere' '
38         test_must_fail git cherry-pick master &&
39         test_must_fail test_cmp expect foo
40 '
41
42 test_done