summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorLibravatar Hariom Verma <hariom18599@gmail.com>2020-08-21 21:41:45 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-08-28 13:52:50 -0700
commite7601eb55bdcd8b241c18e9d9b0106104f4515a1 (patch)
tree7786828c41b18a2c3406a1324ceea5ec2f14fd8b /ref-filter.c
parentref-filter: refactor `grab_objectname()` (diff)
downloadtgif-e7601eb55bdcd8b241c18e9d9b0106104f4515a1.tar.xz
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>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 9bf92db6df..4f4591cad0 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -372,11 +372,11 @@ static int objectname_atom_parser(const struct ref_format *format, struct used_a
atom->u.objectname.option = O_LENGTH;
if (strtoul_ui(arg, 10, &atom->u.objectname.length) ||
atom->u.objectname.length == 0)
- return strbuf_addf_ret(err, -1, _("positive value expected objectname:short=%s"), arg);
+ return strbuf_addf_ret(err, -1, _("positive value expected '%s' in %%(%s)"), arg, atom->name);
if (atom->u.objectname.length < MINIMUM_ABBREV)
atom->u.objectname.length = MINIMUM_ABBREV;
} else
- return strbuf_addf_ret(err, -1, _("unrecognized %%(objectname) argument: %s"), arg);
+ return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name);
return 0;
}