diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-08-02 15:14:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-08-02 16:11:06 -0700 |
commit | 05c1eb10348f159908becc7a6ed6bbcdab24c893 (patch) | |
tree | baa15650daafe64c4c07d463d6ba2996ca958623 /remote-curl.c | |
parent | 77aa93481d1b12372a70959de58917ff815b3bc6 (diff) | |
download | git-05c1eb10348f159908becc7a6ed6bbcdab24c893.tar.gz |
push: teach --force-with-lease to smart-http transport
We have been passing enough information to enable the
compare-and-swap logic down to the transport layer, but the
transport helper was not passing it to smart-http transport.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r-- | remote-curl.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c index 60eda63081..53c8a3d1a3 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -6,6 +6,7 @@ #include "exec_cmd.h" #include "run-command.h" #include "pkt-line.h" +#include "string-list.h" #include "sideband.h" static struct remote *remote; @@ -20,6 +21,7 @@ struct options { thin : 1; }; static struct options options; +static struct string_list cas_options = STRING_LIST_INIT_DUP; static int set_option(const char *name, const char *value) { @@ -66,6 +68,13 @@ static int set_option(const char *name, const char *value) return -1; return 0; } + else if (!strcmp(name, "cas")) { + struct strbuf val = STRBUF_INIT; + strbuf_addf(&val, "--" CAS_OPT_NAME "=%s", value); + string_list_append(&cas_options, val.buf); + strbuf_release(&val); + return 0; + } else { return 1 /* unsupported */; } @@ -789,8 +798,9 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs) struct rpc_state rpc; const char **argv; int argc = 0, i, err; + struct string_list_item *cas_option; - argv = xmalloc((10 + nr_spec) * sizeof(char*)); + argv = xmalloc((10 + nr_spec + cas_options.nr) * sizeof(char *)); argv[argc++] = "send-pack"; argv[argc++] = "--stateless-rpc"; argv[argc++] = "--helper-status"; @@ -803,6 +813,10 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs) else if (options.verbosity > 1) argv[argc++] = "--verbose"; argv[argc++] = options.progress ? "--progress" : "--no-progress"; + + for_each_string_list_item(cas_option, &cas_options) + argv[argc++] = cas_option->string; + argv[argc++] = url; for (i = 0; i < nr_spec; i++) argv[argc++] = specs[i]; |