Skip to content

Commit 2f645b3

Browse files
dschogitster
authored andcommitted
bisect: verify that a bogus option won't try to start a bisection
We do not want `git bisect --bogus-option` to start a bisection. To verify that, we look for the tell-tale error message `You need to start by "git bisect start"` and fail if it was found. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6f97792 commit 2f645b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/t6030-bisect-porcelain.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,16 @@ test_expect_success 'bisect start with one term1 and term2' '
10581058
git bisect reset
10591059
'
10601060

1061+
test_expect_success 'bogus command does not start bisect' '
1062+
git bisect reset &&
1063+
test_must_fail git bisect --bisect-terms 1 2 2>out &&
1064+
! grep "You need to start" out &&
1065+
test_must_fail git bisect --bisect-terms 2>out &&
1066+
! grep "You need to start" out &&
1067+
grep "git bisect.*visualize" out &&
1068+
git bisect reset
1069+
'
1070+
10611071
test_expect_success 'bisect replay with term1 and term2' '
10621072
git bisect replay log_to_replay.txt >bisect_result &&
10631073
grep "$HASH2 is the first term1 commit" bisect_result &&

0 commit comments

Comments
 (0)