Skip to content

Commit 252060b

Browse files
sgnttaylorr
authored andcommitted
bisect--helper: identify as bisect when report error
In a later change, we will convert the bisect--helper to be builtin bisect. Let's start by self-identifying it's the real bisect when reporting error. This change is safe since 'git bisect--helper' is an implementation detail, users aren't expected to call 'git bisect--helper'. Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 8962f8f commit 252060b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

builtin/bisect--helper.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,8 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
12821282
static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNUSED)
12831283
{
12841284
if (argc > 1)
1285-
return error(_("--bisect-reset requires either no argument or a commit"));
1285+
return error(_("'%s' requires either no argument or a commit"),
1286+
"git bisect reset");
12861287
return bisect_reset(argc ? argv[0] : NULL);
12871288
}
12881289

@@ -1292,7 +1293,8 @@ static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNU
12921293
struct bisect_terms terms = { 0 };
12931294

12941295
if (argc > 1)
1295-
return error(_("--bisect-terms requires 0 or 1 argument"));
1296+
return error(_("'%s' requires 0 or 1 argument"),
1297+
"git bisect terms");
12961298
res = bisect_terms(&terms, argc == 1 ? argv[0] : NULL);
12971299
free_terms(&terms);
12981300
return res;
@@ -1315,7 +1317,8 @@ static int cmd_bisect__next(int argc, const char **argv UNUSED, const char *pref
13151317
struct bisect_terms terms = { 0 };
13161318

13171319
if (argc)
1318-
return error(_("--bisect-next requires 0 arguments"));
1320+
return error(_("'%s' requires 0 arguments"),
1321+
"git bisect next");
13191322
get_terms(&terms);
13201323
res = bisect_next(&terms, prefix);
13211324
free_terms(&terms);
@@ -1337,7 +1340,7 @@ static int cmd_bisect__state(int argc, const char **argv, const char *prefix UNU
13371340
static int cmd_bisect__log(int argc, const char **argv UNUSED, const char *prefix UNUSED)
13381341
{
13391342
if (argc)
1340-
return error(_("--bisect-log requires 0 arguments"));
1343+
return error(_("'%s' requires 0 arguments"), "git bisect log");
13411344
return bisect_log();
13421345
}
13431346

@@ -1383,7 +1386,7 @@ static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSE
13831386
struct bisect_terms terms = { 0 };
13841387

13851388
if (!argc)
1386-
return error(_("bisect run failed: no command provided."));
1389+
return error(_("'%s' failed: no command provided."), "git bisect run");
13871390
get_terms(&terms);
13881391
res = bisect_run(&terms, argv, argc);
13891392
free_terms(&terms);

0 commit comments

Comments
 (0)