[PATCH 07/13] bisect--helper: pretend we're real bisect when report error
- From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
- Date
- Nov 5, 2022, 17:07 UTC
- Message-ID
- <f212e6428855f0b0839bf6befd7c4703c505cc66.1667667460.git.congdanhqx@gmail.com>
- In-Reply-To
- <cover.1667667460.git.congdanhqx@gmail.com>
In a later change, we will convert the bisect--helper to be builtin bisect. Let's start by pretending it's the real bisect when reporting error.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> --- builtin/bisect--helper.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c index b99cbb0dbe..6be4d8861e 100644 --- a/builtin/bisect--helper.c +++ b/builtin/bisect--helper.c @@ -1284,7 +1284,8 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc) static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNUSED) { if (argc > 1) - return error(_("--bisect-reset requires either no argument or a commit")); + return error(_("'%s' requires either no argument or a commit"), + "git bisect reset"); return bisect_reset(argc ? argv[0] : NULL); } @@ -1294,7 +1295,8 @@ static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNU struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL }; if (argc > 1) - return error(_("--bisect-terms requires 0 or 1 argument")); + return error(_("'%s' requires 0 or 1 argument"), + "git bisect terms"); res = bisect_terms(&terms, argc == 1 ? argv[0] : NULL); free_terms(&terms); return res; @@ -1317,7 +1319,8 @@ static int cmd_bisect__next(int argc, const char **argv UNUSED, const char *pref struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL }; if (argc) - return error(_("--bisect-next requires 0 arguments")); + return error(_("'%s' requires 0 arguments"), + "git bisect next"); get_terms(&terms); res = bisect_next(&terms, prefix); free_terms(&terms); @@ -1339,7 +1342,7 @@ static int cmd_bisect__state(int argc, const char **argv, const char *prefix UNU static int cmd_bisect__log(int argc, const char **argv UNUSED, const char *prefix UNUSED) { if (argc) - return error(_("--bisect-log requires 0 arguments")); + return error(_("'%s' requires 0 arguments"), "git bisect log"); return bisect_log(); } @@ -1385,7 +1388,7 @@ static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSE struct bisect_terms terms = { .term_good = NULL, .term_bad = NULL }; if (!argc) - return error(_("bisect run failed: no command provided.")); + return error(_("'%s' failed: no command provided."), "git bisect run"); get_terms(&terms); res = bisect_run(&terms, argv, argc); free_terms(&terms);
-- 2.38.1.157.gedabe22e0a