blob: e6a64816efef0e53018c7a56784d1af62602e9d3 [file] [log] [blame]
Abhijit Menon-Senaa1a0112008-08-10 17:18:55 +05301#!/bin/sh
2
3test_description='cherry-pick should rerere for conflicts'
4
5. ./test-lib.sh
6
7test_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 &&
12
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'
18
19test_expect_success 'conflicting merge' '
20 test_must_fail git merge master
21'
22
23test_expect_success 'fixup' '
24 echo foo-dev >foo &&
25 git add foo && test_tick && git commit -q -m 4 &&
Jonathan Niedera48fcd82010-10-30 20:46:54 -050026 git reset --hard HEAD^ &&
Abhijit Menon-Senaa1a0112008-08-10 17:18:55 +053027 echo foo-dev >expect
28'
29
30test_expect_success 'cherry-pick conflict' '
31 test_must_fail git cherry-pick master &&
32 test_cmp expect foo
33'
34
35test_expect_success 'reconfigure' '
Jonathan Niedera48fcd82010-10-30 20:46:54 -050036 git config rerere.enabled false &&
Abhijit Menon-Senaa1a0112008-08-10 17:18:55 +053037 git reset --hard
38'
39
40test_expect_success 'cherry-pick conflict without rerere' '
41 test_must_fail git cherry-pick master &&
42 test_must_fail test_cmp expect foo
43'
44
45test_done