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 <johannes.schindelin@gmx.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 12, 2023 at 16:19 UTC 2f645b33baa607629c08c0821ccd0c12c8b6ab2f
1 file changed +10
t/t6030-bisect-porcelain.sh
+10
@@ -1058,6 +1058,16 @@ test_expect_success 'bisect start with one term1 and term2' '
1058 git bisect reset
1059 '
1060
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 +
1071 test_expect_success 'bisect replay with term1 and term2' '
1072 git bisect replay log_to_replay.txt >bisect_result &&
1073 grep "$HASH2 is the first term1 commit" bisect_result &&