summaryrefslogtreecommitdiff
path: root/refspec.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-09-05 14:49:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-06 20:15:46 (GMT)
commit1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75 (patch)
treecd2da63870b04868b3da654be43241f2b5ce7f48 /refspec.h
parent30035d9c66bc2a52352e3ad42b56047f06c20326 (diff)
downloadgit-1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75.zip
git-1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75.tar.gz
git-1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75.tar.bz2
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 8d654e3..7569248 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);