Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-09-05 17:49:30 +0300
committerJunio C Hamano <gitster@pobox.com>2020-09-06 23:15:46 +0300
commit1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75 (patch)
treecd2da63870b04868b3da654be43241f2b5ce7f48 /refspec.h
parent30035d9c66bc2a52352e3ad42b56047f06c20326 (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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/refspec.h b/refspec.h
index 8d654e3a3a..7569248d11 100644
--- a/refspec.h
+++ b/refspec.h
@@ -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);