archive: reorder option parsing and config reading
[alt-git.git] / t / t3503-cherry-pick-root.sh
blob9aefe3a1becac200f2c29beee84fab278f9fcfa0
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"
23 test_expect_success 'cherry-pick a root commit' '
25 git cherry-pick master &&
26 echo first >expect &&
27 test_cmp expect file1
31 test_expect_success 'revert a root commit' '
33 git revert master &&
34 test_path_is_missing file1
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
46 test_expect_success 'revert a root commit with an external strategy' '
48 git revert --strategy=resolve master &&
49 test_path_is_missing file1
53 test_done