aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7514-commit-patch.sh
blob: b4de10a5ddac0a2a890adaeb559f1b2afea15bb3 (plain) (blame)
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
#!/bin/sh

test_description='hunk edit with "commit -p -m"'
. ./test-lib.sh

test_expect_success 'setup (initial)' '
	echo line1 >file &&
	git add file &&
	git commit -m commit1
'

test_expect_success 'edit hunk "commit -p -m message"' '
	test_when_finished "rm -f editor_was_started" &&
	rm -f editor_was_started &&
	echo more >>file &&
	echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit2 file &&
	test -r editor_was_started
'

test_expect_success 'edit hunk "commit --dry-run -p -m message"' '
	test_when_finished "rm -f editor_was_started" &&
	rm -f editor_was_started &&
	echo more >>file &&
	echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit3 file &&
	test -r editor_was_started
'

test_done