summaryrefslogtreecommitdiff
path: root/t/t3515-revert-subjects.sh
blob: 4c231b48a5a5c95c787e93a3bd29a4c42e90afac (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
#!/bin/sh

test_description='git revert'

. ./test-lib.sh

test_expect_success 'fresh reverts' '
	test_commit --no-tag A file1 &&
	test_commit --no-tag B file1 &&
	git revert --no-edit HEAD &&
	echo "Revert \"B\"" > expect &&
	git log -1 --pretty=%s > actual &&
	test_cmp expect actual &&
	git revert --no-edit HEAD &&
	echo "Reapply \"B\"" > expect &&
	git log -1 --pretty=%s > actual &&
	test_cmp expect actual &&
	git revert --no-edit HEAD &&
	echo "Revert \"Reapply \"B\"\"" > expect &&
	git log -1 --pretty=%s > actual &&
	test_cmp expect actual
'

test_expect_success 'legacy double revert' '
	test_commit --no-tag "Revert \"Revert \"B\"\"" file1 &&
	git revert --no-edit HEAD &&
	echo "Revert \"Reapply \"B\"\"" > expect &&
	git log -1 --pretty=%s > actual &&
	test_cmp expect actual
'

test_done