summaryrefslogtreecommitdiff
path: root/t/t3504-cherry-pick-rerere.sh
blob: 33f902b1b0d8eb651e0e6857f8f5b86ef633ef4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

test_description='cherry-pick should rerere for conflicts'

. ./test-lib.sh

test_expect_success setup '
	test_commit foo &&
	test_commit foo-master foo &&

	git checkout -b dev foo &&
	test_commit foo-dev foo &&
	git config rerere.enabled true
'

test_expect_success 'conflicting merge' '
	test_must_fail git merge master
'

test_expect_success 'fixup' '
	echo foo-resolved >foo &&
	git commit -am resolved &&
	cp foo expect &&
	git reset --hard HEAD^
'

test_expect_success 'cherry-pick conflict' '
	test_must_fail git cherry-pick master &&
	test_cmp expect foo
'

test_expect_success 'reconfigure' '
	git config rerere.enabled false &&
	git reset --hard
'

test_expect_success 'cherry-pick conflict without rerere' '
	test_must_fail git cherry-pick master &&
	test_must_fail test_cmp expect foo
'

test_done