summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-09-19 11:38:31 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-09-19 11:38:31 -0700
commitd9dd4cebec3107545b4354a198ecbc5a141f3f46 (patch)
tree49ee55d74f5347393359b2e4335309304268388b /remote-curl.c
parentgit-svn: delay term initialization (diff)
parentsend-pack: take refspecs over stdin (diff)
downloadtgif-d9dd4cebec3107545b4354a198ecbc5a141f3f46.tar.xz
Merge branch 'jk/send-pack-many-refspecs'
The number of refs that can be pushed at once over smart HTTP was limited by the command line length. The limitation has been lifted by passing these refs from the standard input of send-pack. * jk/send-pack-many-refspecs: send-pack: take refspecs over stdin
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 017ddd9284..645872a4f2 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -862,6 +862,7 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs)
int i, err;
struct argv_array args;
struct string_list_item *cas_option;
+ struct strbuf preamble = STRBUF_INIT;
argv_array_init(&args);
argv_array_pushl(&args, "send-pack", "--stateless-rpc", "--helper-status",
@@ -879,17 +880,22 @@ static int push_git(struct discovery *heads, int nr_spec, char **specs)
for_each_string_list_item(cas_option, &cas_options)
argv_array_push(&args, cas_option->string);
argv_array_push(&args, url.buf);
+
+ argv_array_push(&args, "--stdin");
for (i = 0; i < nr_spec; i++)
- argv_array_push(&args, specs[i]);
+ packet_buf_write(&preamble, "%s\n", specs[i]);
+ packet_buf_flush(&preamble);
memset(&rpc, 0, sizeof(rpc));
rpc.service_name = "git-receive-pack",
rpc.argv = args.argv;
+ rpc.stdin_preamble = &preamble;
err = rpc_service(&rpc, heads);
if (rpc.result.len)
write_or_die(1, rpc.result.buf, rpc.result.len);
strbuf_release(&rpc.result);
+ strbuf_release(&preamble);
argv_array_clear(&args);
return err;
}