summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-08-02 22:14:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-08-02 23:11:06 (GMT)
commit05c1eb10348f159908becc7a6ed6bbcdab24c893 (patch)
treebaa15650daafe64c4c07d463d6ba2996ca958623 /remote-curl.c
parent77aa93481d1b12372a70959de58917ff815b3bc6 (diff)
downloadgit-05c1eb10348f159908becc7a6ed6bbcdab24c893.zip
git-05c1eb10348f159908becc7a6ed6bbcdab24c893.tar.gz
git-05c1eb10348f159908becc7a6ed6bbcdab24c893.tar.bz2
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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 60eda63..53c8a3d 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];