path: root/t/
diff options
authorJeff King <>2014-08-21 12:21:20 (GMT)
committerJunio C Hamano <>2014-08-26 19:58:02 (GMT)
commit26be19ba8d8d2e7e3e288b395e7156d5b7af5140 (patch)
treef025f721c298e2770de4419200a85758671b153b /t/
parent4109c28e055dba27d73cefb956bea5e611f66ec0 (diff)
send-pack: take refspecs over stdin
Pushing a large number of refs works over most transports, because we implement send-pack as an internal function. However, it can sometimes fail when pushing over http, because we have to spawn "git send-pack --stateless-rpc" to do the heavy lifting, and we pass each refspec on the command line. This can cause us to overflow the OS limits on the size of the command line for a large push. We can solve this by giving send-pack a --stdin option and using it from remote-curl. We already dealt with this on the fetch-pack side in 078b895 (fetch-pack: new --stdin option to read refs from stdin, 2012-04-02). The stdin option (and in particular, its use of packet-lines for stateless-rpc input) is modeled after that solution. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 15 insertions, 0 deletions
diff --git a/t/ b/t/
index 73af16f..db19988 100755
--- a/t/
+++ b/t/
@@ -323,5 +323,20 @@ test_expect_success 'push into half-auth-complete requires password' '
test_cmp expect actual
+run_with_limited_cmdline () {
+ (ulimit -s 128 && "$@")
+test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'
+test_expect_success CMDLINE_LIMIT 'push 2000 tags over http' '
+ sha1=$(git rev-parse HEAD) &&
+ test_seq 2000 |
+ sort |
+ sed "s|.*|$sha1 refs/tags/really-long-tag-name-&|" \
+ >.git/packed-refs &&
+ run_with_limited_cmdline git push --mirror