t3503: test cherry picking and reverting root commits
We already tested cherry-picking a root commit, but only with the internal merge-recursive strategy. Let's also test the recently-allowed reverting of a root commit, as well as testing with external strategies (which until recently triggered a segfault). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 12, 2011 at 07:10 UTC
e9fe74cba4ed4577dcc02f61094c611a1c216fee
1 file changed
+25
-2
t/t3503-cherry-pick-root.sh
+25
-2
@@ -1,6 +1,6 @@
1
#!/bin/sh
2
3
-test_description='test cherry-picking a root commit'
3
+test_description='test cherry-picking (and reverting) a root commit'
4
5
. ./test-lib.sh
6
@@ -23,7 +23,30 @@ test_expect_success setup '
23
test_expect_success 'cherry-pick a root commit' '
24
25
git cherry-pick master &&
26
- test first = $(cat file1)
26
+ echo first >expect &&
27
+ test_cmp expect file1
28
+
29
+'
30
+
31
+test_expect_success 'revert a root commit' '
32
+
33
+ git revert master &&
34
+ test_path_is_missing file1
35
+
36
+'
37
+
38
+test_expect_success 'cherry-pick a root commit with an external strategy' '
39
+
40
+ git cherry-pick --strategy=resolve master &&
41
+ echo first >expect &&
42
+ test_cmp expect file1
43
+
44
+'
45
+
46
+test_expect_success 'revert a root commit with an external strategy' '
47
+
48
+ git revert --strategy=resolve master &&
49
+ test_path_is_missing file1
50
51
'
52