mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
3c2a3fdc38
commit
e36091aa1d
5
strbuf.h
5
strbuf.h
@@ -337,6 +337,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
|
||||
|
||||
Reference in New Issue
Block a user