Skip to content

Commit e7601eb

Browse files
harry-hovgitster
authored andcommitted
ref-filter: modify error messages in grab_objectname()
As we plan to use `grab_objectname()` for `tree` and `parent` atom, it's better to parameterize the error messages in the function `grab_objectname()` where "objectname" is hard coded. Mentored-by: Christian Couder <[email protected]> Mentored-by: Heba Waly <[email protected]> Signed-off-by: Hariom Verma <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5101100 commit e7601eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ref-filter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,11 @@ static int objectname_atom_parser(const struct ref_format *format, struct used_a
372372
atom->u.objectname.option = O_LENGTH;
373373
if (strtoul_ui(arg, 10, &atom->u.objectname.length) ||
374374
atom->u.objectname.length == 0)
375-
return strbuf_addf_ret(err, -1, _("positive value expected objectname:short=%s"), arg);
375+
return strbuf_addf_ret(err, -1, _("positive value expected '%s' in %%(%s)"), arg, atom->name);
376376
if (atom->u.objectname.length < MINIMUM_ABBREV)
377377
atom->u.objectname.length = MINIMUM_ABBREV;
378378
} else
379-
return strbuf_addf_ret(err, -1, _("unrecognized %%(objectname) argument: %s"), arg);
379+
return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name);
380380
return 0;
381381
}
382382

0 commit comments

Comments
 (0)