send-pack: send push options correctly in stateless-rpc case
commiteb7b9749f2b7bc0d0e0ac2c68d98cf1b8f4a2761
authorBrandon Williams <bmwill@google.com>
Wed, 22 Mar 2017 22:21:59 +0000 (22 15:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Mar 2017 22:41:15 +0000 (22 15:41 -0700)
treeb4bbd36898227bfb869d6f7b89c7d884beb5be65
parent438fc68462d5839ef6ca231cdcb411105eaf0ba2
send-pack: send push options correctly in stateless-rpc case

"git send-pack --stateless-rpc" puts each request in a sequence of pkt-lines
followed by a flush-pkt. The push option code forgot about this and sends push
options and their terminating delimiter as ordinary pkt-lines that get their
length header stripped off by remote-curl before being sent to the server.

The result is multiple malformed requests, which the server rejects.

Fortunately send-pack --stateless-rpc already is aware of this "pkt-line within
pkt-line" framing for the update commands that precede push options. Handle
push options the same way.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
send-pack.c