summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-04-06 11:39:12 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-04-06 11:39:12 -0700
commit01e1d54418a016fb305cb29295f54a86c57dc316 (patch)
treef187a2e092eb7900fd557d1f76612d6340e90b2f /quote.c
parentMerge branch 'jv/merge-nothing-into-void' (diff)
parentgit_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS (diff)
downloadtgif-01e1d54418a016fb305cb29295f54a86c57dc316.tar.xz
Merge branch 'jk/submodule-c-credential'
"git -c credential.<var>=<value> submodule" can now be used to propagate configuration variables related to credential helper down to the submodules. * jk/submodule-c-credential: git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS git: submodule honor -c credential.* from command line quote: implement sq_quotef() submodule: fix segmentation fault in submodule--helper clone submodule: fix submodule--helper clone usage submodule: check argc count for git submodule--helper clone submodule: don't pass empty string arguments to submodule--helper clone
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/quote.c b/quote.c
index fe884d2452..b281a8fe45 100644
--- a/quote.c
+++ b/quote.c
@@ -43,6 +43,19 @@ void sq_quote_buf(struct strbuf *dst, const char *src)
free(to_free);
}
+void sq_quotef(struct strbuf *dst, const char *fmt, ...)
+{
+ struct strbuf src = STRBUF_INIT;
+
+ va_list ap;
+ va_start(ap, fmt);
+ strbuf_vaddf(&src, fmt, ap);
+ va_end(ap);
+
+ sq_quote_buf(dst, src.buf);
+ strbuf_release(&src);
+}
+
void sq_quote_argv(struct strbuf *dst, const char** argv, size_t maxlen)
{
int i;