diff options
author | René Scharfe <l.s.r@web.de> | 2024-03-24 12:19:40 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-25 11:59:24 -0700 |
commit | e36091aa1d67cedba02ea9de9245f0ff14a52f15 (patch) | |
tree | f3bca1f45a8d8f54955acda7ff517f6432dc30e3 /strbuf.h | |
parent | 3c2a3fdc388747b9eaf4a4a4f2035c1c9ddb26d0 (diff) | |
download | git-e36091aa1d67cedba02ea9de9245f0ff14a52f15.tar.gz |
factor out strbuf_expand_bad_format()
Extract a function for reporting placeholders that are not enclosed in a
parenthesis or are unknown. This reduces the number of strings to
translate and improves consistency across commands. Call it at the end
of the if/else chain, after exhausting all accepted possibilities.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -338,6 +338,11 @@ size_t strbuf_expand_literal(struct strbuf *sb, const char *placeholder); int strbuf_expand_step(struct strbuf *sb, const char **formatp); /** + * Used with `strbuf_expand_step` to report unknown placeholders. + */ +void strbuf_expand_bad_format(const char *format, const char *command); + +/** * Append the contents of one strbuf to another, quoting any * percent signs ("%") into double-percents ("%%") in the * destination. This is useful for literal data to be fed to either |