From: Xing Xin via GitGitGadget Date: Mon, 02 Sep 2024 12:13:55 GMT Subject: [PATCH 3/4] builtin/clone.c: recognize fetch.serverOption configuration Message-ID: <7c3ebda513d872a2ab2aa0cff5887757de4cde0a.1725279236.git.gitgitgadget@gmail.com> In-Reply-To: From: Xing Xin Teach git-clone to recognize the `fetch.serverOption` configuration as a default list of server options to send for Git protocol v2, if server options are not explicitly set via the command line. Note that `builtin/clone.c:cmd_clone` originally read the git config twice via `builtin/clone.c:git_clone_config`, which would duplicate server options if parsing logic were added there. Upon investigation, it was found that the first config read is unnecessary since all the global variables it sets are actually used after the second config read. Therefore, the first config read is replaced with a simple `config.c:git_default_config`. Tests and documentation have been updated accordingly. Signed-off-by: Xing Xin --- Documentation/git-clone.txt | 3 +++ builtin/clone.c | 22 ++++++++++++++++------ t/t5702-protocol-v2.sh | 22 ++++++++++++++++++++-- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 8e925db7e9c..105645ed685 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -149,6 +149,9 @@ objects from the source repository into a pack in the cloned repository. unknown ones, is server-specific. When multiple ++--server-option=++__