diff options
author | René Scharfe <l.s.r@web.de> | 2020-09-05 17:49:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-06 23:15:46 +0300 |
commit | 1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75 (patch) | |
tree | cd2da63870b04868b3da654be43241f2b5ce7f48 /refspec.h | |
parent | 30035d9c66bc2a52352e3ad42b56047f06c20326 (diff) |
refspec: add and use refspec_appendf()
Add a function for building a refspec using printf-style formatting. It
frees callers from managing their own buffer. Use it throughout the
tree to shorten and simplify its callers.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.h')
-rw-r--r-- | refspec.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -56,6 +56,8 @@ void refspec_item_init_or_die(struct refspec_item *item, const char *refspec, void refspec_item_clear(struct refspec_item *item); void refspec_init(struct refspec *rs, int fetch); void refspec_append(struct refspec *rs, const char *refspec); +__attribute__((format (printf,2,3))) +void refspec_appendf(struct refspec *rs, const char *fmt, ...); void refspec_appendn(struct refspec *rs, const char **refspecs, int nr); void refspec_clear(struct refspec *rs); |