Skip to content

Commit be414e1

Browse files
committed
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
2 parents ee335b9 + 2bb3a01 commit be414e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

builtin/bisect.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,13 @@ int cmd_bisect(int argc,
14531453
if (!argc)
14541454
usage_msg_opt(_("need a command"), git_bisect_usage, options);
14551455

1456+
if (!strcmp(argv[0], "help"))
1457+
usage_with_options(git_bisect_usage, options);
1458+
14561459
set_terms(&terms, "bad", "good");
14571460
get_terms(&terms);
1458-
if (check_and_set_terms(&terms, argv[0]))
1461+
if (check_and_set_terms(&terms, argv[0]) ||
1462+
!one_of(argv[0], terms.term_good, terms.term_bad, NULL))
14591463
usage_msg_optf(_("unknown command: '%s'"), git_bisect_usage,
14601464
options, argv[0]);
14611465
res = bisect_state(&terms, argc, argv);

0 commit comments

Comments
 (0)