Merge branch 'rz/bisect-help-unknown'

"git bisect" command did not react correctly to "git bisect help"
and "git bisect unknown", which has been corrected.

* rz/bisect-help-unknown:
  bisect: fix handling of `help` and invalid subcommands
main
Junio C Hamano 2025-10-30 08:00:20 -07:00
commit be414e17e5
1 changed files with 5 additions and 1 deletions

View File

@ -1453,9 +1453,13 @@ int cmd_bisect(int argc,
if (!argc)
usage_msg_opt(_("need a command"), git_bisect_usage, options);

if (!strcmp(argv[0], "help"))
usage_with_options(git_bisect_usage, options);

set_terms(&terms, "bad", "good");
get_terms(&terms);
if (check_and_set_terms(&terms, argv[0]))
if (check_and_set_terms(&terms, argv[0]) ||
!one_of(argv[0], terms.term_good, terms.term_bad, NULL))
usage_msg_optf(_("unknown command: '%s'"), git_bisect_usage,
options, argv[0]);
res = bisect_state(&terms, argc, argv);