remote-curl: unquote incoming push-options
commit90dce21eb0fcf28096e661a3dd3b4e93fa0bccb5
authorJeff King <peff@peff.net>
Mon, 19 Feb 2018 19:50:14 +0000 (19 14:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Feb 2018 19:27:06 +0000 (20 11:27 -0800)
treeceb454eaaec086ea142c95d09078a25751b73e33
parent6cdffd06d6ce1e997963790f9206fc981715fbbb
remote-curl: unquote incoming push-options

The transport-helper protocol c-style quotes the value of
any options passed to the helper via the "option <key> <value>"
directive. However, remote-curl doesn't actually unquote the
push-option values, meaning that we will send the quoted
version to the other side (whereas git-over-ssh would send
the raw value).

The pack-protocol.txt documentation defines the push-options
as a series of VCHARs, which excludes most characters that
would need quoting. But:

  1. You can still see the bug with a valid push-option that
     starts with a double-quote (since that triggers
     quoting).

  2. We do currently handle any non-NUL characters correctly
     in git-over-ssh. So even though the spec does not say
     that we need to handle most quoted characters, it's
     nice if our behavior is consistent between protocols.

There are two new tests: the "direct" one shows that this
already works in the non-http case, and the http one covers
this bugfix.

Reported-by: Jon Simons <jon@jonsimons.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote-curl.c
t/t5545-push-options.sh