summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-23 05:43:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-23 05:43:11 (GMT)
commitd45d771978c3d5bead096934cad16ddfb9fced37 (patch)
treed37c8a011d0599f989ea378b5860f9b3e4e5996f /remote-curl.c
parent22dd22dce050f042b3eec165440966186691db42 (diff)
parent6f1194246a514ba093a11dde73aabe4c0da5526f (diff)
downloadgit-d45d771978c3d5bead096934cad16ddfb9fced37.zip
git-d45d771978c3d5bead096934cad16ddfb9fced37.tar.gz
git-d45d771978c3d5bead096934cad16ddfb9fced37.tar.bz2
Merge branch 'bc/smart-http-atomic-push'
The atomic push over smart HTTP transport did not work, which has been corrected. * bc/smart-http-atomic-push: remote-curl: pass on atomic capability to remote side
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 1612e7f..350d92a 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -40,7 +40,8 @@ struct options {
push_cert : 2,
deepen_relative : 1,
from_promisor : 1,
- no_dependents : 1;
+ no_dependents : 1,
+ atomic : 1;
};
static struct options options;
static struct string_list cas_options = STRING_LIST_INIT_DUP;
@@ -148,6 +149,14 @@ static int set_option(const char *name, const char *value)
else
return -1;
return 0;
+ } else if (!strcmp(name, "atomic")) {
+ if (!strcmp(value, "true"))
+ options.atomic = 1;
+ else if (!strcmp(value, "false"))
+ options.atomic = 0;
+ else
+ return -1;
+ return 0;
} else if (!strcmp(name, "push-option")) {
if (*value != '"')
string_list_append(&options.push_options, value);
@@ -1196,6 +1205,8 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
argv_array_push(&args, "--signed=yes");
else if (options.push_cert == SEND_PACK_PUSH_CERT_IF_ASKED)
argv_array_push(&args, "--signed=if-asked");
+ if (options.atomic)
+ argv_array_push(&args, "--atomic");
if (options.verbosity == 0)
argv_array_push(&args, "--quiet");
else if (options.verbosity > 1)