From 094f78a16a6c150ff125afd9c3f2773b47384c06 Mon Sep 17 00:00:00 2001 From: Xing Xin Date: Tue, 8 Oct 2024 03:38:17 +0000 Subject: [PATCH] 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 Reviewed-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- Documentation/fetch-options.txt | 3 + Documentation/git-clone.txt | 3 + Documentation/git-ls-remote.txt | 3 + t/t5702-protocol-v2.sh | 123 ++++++++++++++++++++++++++++++++ transport.c | 3 + 5 files changed, 135 insertions(+) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 80838fe37e..9dc7ac8dbd 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -305,6 +305,9 @@ endif::git-pull[] unknown ones, is server-specific. When multiple `--server-option=