diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-06 11:39:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-06 11:39:12 -0700 |
commit | 01e1d54418a016fb305cb29295f54a86c57dc316 (patch) | |
tree | f187a2e092eb7900fd557d1f76612d6340e90b2f /quote.c | |
parent | Merge branch 'jv/merge-nothing-into-void' (diff) | |
parent | git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS (diff) | |
download | tgif-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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |