ref-filter: factor out "unrecognized %(foo) arg" errors
commitdda4fc1a849e2407c30b4619d64221c2b38bd570
authorJeff King <peff@peff.net>
Wed, 14 Dec 2022 16:20:19 +0000 (14 11:20 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Dec 2022 00:14:00 +0000 (15 09:14 +0900)
tree34b3dc0ed8f02ab44769de17ee20a87a389c47fa
parenta33d0fae76ab95e88d383793cac41934920296ba
ref-filter: factor out "unrecognized %(foo) arg" errors

Atom parsers that take arguments generally have a catch-all for "this
arg is not recognized". Most of them use the same printf template, which
is good, because it makes life easier for translators. Let's pull this
template into a helper function, which makes the code in the parsers
shorter and avoids any possibility of differences.

As with the previous commit, we'll pick an arbitrary atom to make sure
the test suite covers this code.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c
t/t6300-for-each-ref.sh