summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-28 21:37:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-28 21:37:58 (GMT)
commit69917e64396030bdd94e965e494d22ecb3caa6ca (patch)
treebc5530d483b9b19c98a2db9bc988013e186f24ae /remote-curl.c
parent09967278795fa0b36e7f1308c2063005a263d936 (diff)
parent90dce21eb0fcf28096e661a3dd3b4e93fa0bccb5 (diff)
downloadgit-69917e64396030bdd94e965e494d22ecb3caa6ca.zip
git-69917e64396030bdd94e965e494d22ecb3caa6ca.tar.gz
git-69917e64396030bdd94e965e494d22ecb3caa6ca.tar.bz2
Merge branch 'jk/push-options-via-transport-fix'
"git push" over http transport did not unquote the push-options correctly. * jk/push-options-via-transport-fix: remote-curl: unquote incoming push-options t5545: factor out http repository setup
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index e11e619..a7c4c9b 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -13,6 +13,7 @@
#include "credential.h"
#include "sha1-array.h"
#include "send-pack.h"
+#include "quote.h"
static struct remote *remote;
/* always ends with a trailing slash */
@@ -145,7 +146,15 @@ static int set_option(const char *name, const char *value)
return -1;
return 0;
} else if (!strcmp(name, "push-option")) {
- string_list_append(&options.push_options, value);
+ if (*value != '"')
+ string_list_append(&options.push_options, value);
+ else {
+ struct strbuf unquoted = STRBUF_INIT;
+ if (unquote_c_style(&unquoted, value, NULL) < 0)
+ die("invalid quoting in push-option value");
+ string_list_append_nodup(&options.push_options,
+ strbuf_detach(&unquoted, NULL));
+ }
return 0;
#if LIBCURL_VERSION_NUM >= 0x070a08