File: t3504-cherry-pick-rerere.sh

package info (click to toggle)
cgit 0.10.2.git2.0.1-3%2Bdeb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 26,640 kB
  • ctags: 19,675
  • sloc: ansic: 159,238; sh: 129,259; perl: 29,890; tcl: 21,214; python: 5,362; makefile: 3,295; lisp: 1,786; php: 120; asm: 98; csh: 45
file content (45 lines) | stat: -rwxr-xr-x 988 bytes parent folder | download | duplicates (11)
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
43
44
45
#!/bin/sh

test_description='cherry-pick should rerere for conflicts'

. ./test-lib.sh

test_expect_success setup '
	echo foo >foo &&
	git add foo && test_tick && git commit -q -m 1 &&
	echo foo-master >foo &&
	git add foo && test_tick && git commit -q -m 2 &&

	git checkout -b dev HEAD^ &&
	echo foo-dev >foo &&
	git add foo && test_tick && git commit -q -m 3 &&
	git config rerere.enabled true
'

test_expect_success 'conflicting merge' '
	test_must_fail git merge master
'

test_expect_success 'fixup' '
	echo foo-dev >foo &&
	git add foo && test_tick && git commit -q -m 4 &&
	git reset --hard HEAD^ &&
	echo foo-dev >expect
'

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