@@ -23,7 +23,7 @@ test_expect_success setup '
2323'
2424
2525test_expect_success ' cherry-pick first..fourth works' '
26- git checkout master &&
26+ git checkout -f master &&
2727 git reset --hard first &&
2828 test_tick &&
2929 git cherry-pick first..fourth &&
@@ -33,7 +33,7 @@ test_expect_success 'cherry-pick first..fourth works' '
3333'
3434
3535test_expect_success ' cherry-pick --ff first..fourth works' '
36- git checkout master &&
36+ git checkout -f master &&
3737 git reset --hard first &&
3838 test_tick &&
3939 git cherry-pick --ff first..fourth &&
@@ -43,7 +43,7 @@ test_expect_success 'cherry-pick --ff first..fourth works' '
4343'
4444
4545test_expect_success ' cherry-pick -n first..fourth works' '
46- git checkout master &&
46+ git checkout -f master &&
4747 git reset --hard first &&
4848 test_tick &&
4949 git cherry-pick -n first..fourth &&
@@ -53,7 +53,7 @@ test_expect_success 'cherry-pick -n first..fourth works' '
5353'
5454
5555test_expect_success ' revert first..fourth works' '
56- git checkout master &&
56+ git checkout -f master &&
5757 git reset --hard fourth &&
5858 test_tick &&
5959 git revert first..fourth &&
@@ -63,7 +63,7 @@ test_expect_success 'revert first..fourth works' '
6363'
6464
6565test_expect_success ' revert ^first fourth works' '
66- git checkout master &&
66+ git checkout -f master &&
6767 git reset --hard fourth &&
6868 test_tick &&
6969 git revert ^first fourth &&
@@ -73,7 +73,7 @@ test_expect_success 'revert ^first fourth works' '
7373'
7474
7575test_expect_success ' revert fourth fourth~1 fourth~2 works' '
76- git checkout master &&
76+ git checkout -f master &&
7777 git reset --hard fourth &&
7878 test_tick &&
7979 git revert fourth fourth~1 fourth~2 &&
@@ -82,8 +82,8 @@ test_expect_success 'revert fourth fourth~1 fourth~2 works' '
8282 git diff --quiet HEAD first
8383'
8484
85- test_expect_failure ' cherry-pick -3 fourth works' '
86- git checkout master &&
85+ test_expect_success ' cherry-pick -3 fourth works' '
86+ git checkout -f master &&
8787 git reset --hard first &&
8888 test_tick &&
8989 git cherry-pick -3 fourth &&
@@ -92,4 +92,14 @@ test_expect_failure 'cherry-pick -3 fourth works' '
9292 test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify fourth)"
9393'
9494
95+ test_expect_success ' cherry-pick --stdin works' '
96+ git checkout -f master &&
97+ git reset --hard first &&
98+ test_tick &&
99+ git rev-list --reverse first..fourth | git cherry-pick --stdin &&
100+ git diff --quiet other &&
101+ git diff --quiet HEAD other &&
102+ test "$(git rev-parse --verify HEAD)" != "$(git rev-parse --verify fourth)"
103+ '
104+
95105test_done
0 commit comments