Skip to content

Commit bf71009

Browse files
artagnongitster
authored andcommitted
t3502, t3510: clarify cherry-pick -m failure
The "cherry-pick persists opts correctly" test in t3510 (cherry-pick-sequence) can cause some confusion, because the command actually has two points of failure: 1. "-m 1" is specified on the command-line despite the base commit "initial" not being a merge-commit. 2. The revision range indicates that there will be a conflict that needs to be resolved. Although the former error is trapped, and cherry-pick die()s with the exit status 128, the reader may be distracted by the latter. Fix this by changing the revision range to something that wouldn't cause a conflict. Additionally, explicitly check the exit code in "cherry-pick a non-merge with -m should fail" in t3502 (cherry-pick-merge) to reassure the reader that this failure has nothing to do with the sequencer itself. Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c6b7c7f commit bf71009

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/t3502-cherry-pick-merge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test_expect_success 'cherry-pick a non-merge with -m should fail' '
3535
3636
git reset --hard &&
3737
git checkout a^0 &&
38-
test_must_fail git cherry-pick -m 1 b &&
38+
test_expect_code 128 git cherry-pick -m 1 b &&
3939
git diff --exit-code a --
4040
4141
'

t/t3510-cherry-pick-sequence.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test_expect_success 'cherry-pick mid-cherry-pick-sequence' '
6767

6868
test_expect_success 'cherry-pick persists opts correctly' '
6969
pristine_detach initial &&
70-
test_expect_code 128 git cherry-pick -s -m 1 --strategy=recursive -X patience -X ours base..anotherpick &&
70+
test_expect_code 128 git cherry-pick -s -m 1 --strategy=recursive -X patience -X ours initial..anotherpick &&
7171
test_path_is_dir .git/sequencer &&
7272
test_path_is_file .git/sequencer/head &&
7373
test_path_is_file .git/sequencer/todo &&

0 commit comments

Comments
 (0)