]> git.ipfire.org Git - thirdparty/git.git/commit
transport.c::handshake: make use of server options from remote
authorXing Xin <xingxin.xx@bytedance.com>
Tue, 8 Oct 2024 03:38:17 +0000 (03:38 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Oct 2024 17:22:08 +0000 (10:22 -0700)
commit094f78a16a6c150ff125afd9c3f2773b47384c06
treebfb4f22d98efb40b762357519f57aa2d2ab0154e
parent72da5cfb1c81a1835a1f6bad5f19451baf9ad03c
transport.c::handshake: make use of server options from remote

Utilize the `server_options` from the corresponding remote during the
handshake in `transport.c` when Git protocol v2 is detected. This helps
initialize the `server_options` in `transport.h:transport` if no server
options are set for the transport (typically via `--server-option` or
`-o`).

While another potential place to incorporate server options from the
remote is in `transport.c:transport_get`, setting server options for a
transport using a protocol other than v2 could lead to unexpected errors
(see `transport.c:die_if_server_options`).

Relevant tests and documentation have been updated accordingly.

Signed-off-by: Xing Xin <xingxin.xx@bytedance.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/fetch-options.txt
Documentation/git-clone.txt
Documentation/git-ls-remote.txt
t/t5702-protocol-v2.sh
transport.c