[PATCH v5 01/13] bisect--helper: BUG() in cmd_*() on invalid subcommand
From: Miriam Rubio <hidden>
Date: 2020-07-17 10:54:41
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Miriam Rubio <hidden>
Date: 2020-07-17 10:54:41
Subsystem:
the rest · Maintainer:
Linus Torvalds
In cmd_bisect__helper() function, there would be a bug if an invalid or no subcommand was passed.return error() should be replaced by BUG() in that case. Mentored-by: Christian Couder [off-list ref] Mentored-by: Johannes Schindelin [off-list ref] Signed-off-by: Miriam Rubio <redacted> --- builtin/bisect--helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index ec4996282e..c452d3f6b7 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c@@ -716,7 +716,7 @@ int cmd_bisect__helper(int argc, const char **argv, const char *prefix) res = bisect_start(&terms, no_checkout, argv, argc); break; default: - return error("BUG: unknown subcommand '%d'", cmdmode); + BUG("unknown subcommand %d", (int)cmdmode); } free_terms(&terms);
--
2.25.0