diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:20 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:20 -0700 |
| commit | be414e17e53fea5c8b738d048b03a9678e23f371 (patch) | |
| tree | 2c41822bc566018431afcc0d8e8c11f5f84f0bb5 | |
| parent | ee335b9f816485842739c26f4e75fe6d29d31cdb (diff) | |
| parent | 2bb3a012f3d756ad7101c359f38285a018f9e517 (diff) | |
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
| -rw-r--r-- | builtin/bisect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/bisect.c b/builtin/bisect.c index 8b8d870cd1..993caf545d 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -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); |
