Code

attr: fix leak in free_attr_elem
[git.git] / t / t3503-cherry-pick-root.sh
1 #!/bin/sh
3 test_description='test cherry-picking (and reverting) a root commit'
5 . ./test-lib.sh
7 test_expect_success setup '
9         echo first > file1 &&
10         git add file1 &&
11         test_tick &&
12         git commit -m "first" &&
14         git symbolic-ref HEAD refs/heads/second &&
15         rm .git/index file1 &&
16         echo second > file2 &&
17         git add file2 &&
18         test_tick &&
19         git commit -m "second"
21 '
23 test_expect_success 'cherry-pick a root commit' '
25         git cherry-pick master &&
26         echo first >expect &&
27         test_cmp expect file1
29 '
31 test_expect_success 'revert a root commit' '
33         git revert master &&
34         test_path_is_missing file1
36 '
38 test_expect_success 'cherry-pick a root commit with an external strategy' '
40         git cherry-pick --strategy=resolve master &&
41         echo first >expect &&
42         test_cmp expect file1
44 '
46 test_expect_success 'revert a root commit with an external strategy' '
48         git revert --strategy=resolve master &&
49         test_path_is_missing file1
51 '
53 test_done