about summary refs log tree commit diff
path: root/third_party/git/remote-curl.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/remote-curl.c')
-rw-r--r--third_party/git/remote-curl.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/third_party/git/remote-curl.c b/third_party/git/remote-curl.c
index e4cd3218447f..051f26629d7b 100644
--- a/third_party/git/remote-curl.c
+++ b/third_party/git/remote-curl.c
@@ -40,8 +40,7 @@ struct options {
 		push_cert : 2,
 		deepen_relative : 1,
 		from_promisor : 1,
-		no_dependents : 1,
-		atomic : 1;
+		no_dependents : 1;
 };
 static struct options options;
 static struct string_list cas_options = STRING_LIST_INIT_DUP;
@@ -149,14 +148,6 @@ 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);
@@ -1026,7 +1017,6 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
 
 	walker = get_http_walker(url.buf);
 	walker->get_verbosely = options.verbosity >= 3;
-	walker->get_progress = options.progress;
 	walker->get_recover = 0;
 	ret = walker_fetch(walker, nr_heads, targets, NULL, NULL);
 	walker_free(walker);
@@ -1164,7 +1154,7 @@ static void parse_fetch(struct strbuf *buf)
 	strbuf_reset(buf);
 }
 
-static int push_dav(int nr_spec, const char **specs)
+static int push_dav(int nr_spec, char **specs)
 {
 	struct child_process child = CHILD_PROCESS_INIT;
 	size_t i;
@@ -1185,7 +1175,7 @@ static int push_dav(int nr_spec, const char **specs)
 	return 0;
 }
 
-static int push_git(struct discovery *heads, int nr_spec, const char **specs)
+static int push_git(struct discovery *heads, int nr_spec, char **specs)
 {
 	struct rpc_state rpc;
 	int i, err;
@@ -1206,8 +1196,6 @@ 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)
@@ -1237,7 +1225,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
 	return err;
 }
 
-static int push(int nr_spec, const char **specs)
+static int push(int nr_spec, char **specs)
 {
 	struct discovery *heads = discover_refs("git-receive-pack", 1);
 	int ret;
@@ -1252,13 +1240,14 @@ static int push(int nr_spec, const char **specs)
 
 static void parse_push(struct strbuf *buf)
 {
-	struct argv_array specs = ARGV_ARRAY_INIT;
-	int ret;
+	char **specs = NULL;
+	int alloc_spec = 0, nr_spec = 0, i, ret;
 
 	do {
-		const char *arg;
-		if (skip_prefix(buf->buf, "push ", &arg))
-			argv_array_push(&specs, arg);
+		if (starts_with(buf->buf, "push ")) {
+			ALLOC_GROW(specs, nr_spec + 1, alloc_spec);
+			specs[nr_spec++] = xstrdup(buf->buf + 5);
+		}
 		else
 			die(_("http transport does not support %s"), buf->buf);
 
@@ -1269,7 +1258,7 @@ static void parse_push(struct strbuf *buf)
 			break;
 	} while (1);
 
-	ret = push(specs.argc, specs.argv);
+	ret = push(nr_spec, specs);
 	printf("\n");
 	fflush(stdout);
 
@@ -1277,7 +1266,9 @@ static void parse_push(struct strbuf *buf)
 		exit(128); /* error already reported */
 
  free_specs:
-	argv_array_clear(&specs);
+	for (i = 0; i < nr_spec; i++)
+		free(specs[i]);
+	free(specs);
 }
 
 static int stateless_connect(const char *service_name)