Skip to content

Commit d023c24

Browse files
martinvonzgitster
authored andcommitted
demonstrate broken 'git cherry-pick three one two'
Cherry-picking commits out of order (w.r.t. commit time stamp) doesn't currently work. Add a test case to demonstrate it. Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca92e59 commit d023c24

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/t3508-cherry-pick-many-commits.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ test_expect_success 'cherry-pick first..fourth works' '
4444
check_head_differs_from fourth
4545
'
4646

47+
test_expect_failure 'cherry-pick three one two works' '
48+
git checkout -f first &&
49+
test_commit one &&
50+
test_commit two &&
51+
test_commit three &&
52+
git checkout -f master &&
53+
git reset --hard first &&
54+
git cherry-pick three one two &&
55+
git diff --quiet three &&
56+
git diff --quiet HEAD three &&
57+
test "$(git log --reverse --format=%s first..)" = "three
58+
one
59+
two"
60+
'
61+
4762
test_expect_success 'output to keep user entertained during multi-pick' '
4863
cat <<-\EOF >expected &&
4964
[master OBJID] second

0 commit comments

Comments
 (0)