@matheusbsbs / matheus-bagliano / commits / e7601eb55b
Fork 0

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 <chriscool@tuxfamily.org> Mentored-by: Heba Waly <heba.waly@gmail.com> Signed-off-by: Hariom Verma <hariom18599@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Hariom Verma committed Aug 21, 2020 at 21:41 UTC e7601eb55bdcd8b241c18e9d9b0106104f4515a1
1 file changed +2 -2
ref-filter.c
+2 -2
@@ -372,11 +372,11 @@ static int objectname_atom_parser(const struct ref_format *format, struct used_a
372 atom->u.objectname.option = O_LENGTH;
373 if (strtoul_ui(arg, 10, &atom->u.objectname.length) ||
374 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);
376 if (atom->u.objectname.length < MINIMUM_ABBREV)
377 atom->u.objectname.length = MINIMUM_ABBREV;
378 } 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);
380 return 0;
381 }
382