diff options
| author | Taylor Blau <me@ttaylorr.com> | 2024-10-15 16:56:43 -0400 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2024-10-15 16:56:43 -0400 |
| commit | fd98f659fda5a7704b10033f2b2efdae2b0a58e6 (patch) | |
| tree | c917e68cfe31b741e4aad16922ce7d5466f36dc4 /remote.c | |
| parent | 8a5545b949287eb09597d1c37130539f50a2e09a (diff) | |
| parent | 0f490d270aa015f0bcb6a99c666eaa5b83f5d375 (diff) | |
| download | git-fd98f659fda5a7704b10033f2b2efdae2b0a58e6.tar.gz | |
Merge branch 'xx/remote-server-option-config'
A new configuration variable remote.<name>.serverOption makes the
transport layer act as if the --serverOption=<value> option is
given from the command line.
* xx/remote-server-option-config:
ls-remote: leakfix for not clearing server_options
fetch: respect --server-option when fetching multiple remotes
transport.c::handshake: make use of server options from remote
remote: introduce remote.<name>.serverOption configuration
transport: introduce parse_transport_option() method
Diffstat (limited to 'remote.c')
| -rw-r--r-- | remote.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -24,6 +24,7 @@ #include "advice.h" #include "connect.h" #include "parse-options.h" +#include "transport.h" enum map_direction { FROM_SRC, FROM_DST }; @@ -143,6 +144,7 @@ static struct remote *make_remote(struct remote_state *remote_state, ret->name = xstrndup(name, len); refspec_init(&ret->push, REFSPEC_PUSH); refspec_init(&ret->fetch, REFSPEC_FETCH); + string_list_init_dup(&ret->server_options); ALLOC_GROW(remote_state->remotes, remote_state->remotes_nr + 1, remote_state->remotes_alloc); @@ -166,6 +168,7 @@ static void remote_clear(struct remote *remote) free((char *)remote->uploadpack); FREE_AND_NULL(remote->http_proxy); FREE_AND_NULL(remote->http_proxy_authmethod); + string_list_clear(&remote->server_options, 0); } static void add_merge(struct branch *branch, const char *name) @@ -508,6 +511,9 @@ static int handle_config(const char *key, const char *value, } else if (!strcmp(subkey, "vcs")) { FREE_AND_NULL(remote->foreign_vcs); return git_config_string(&remote->foreign_vcs, key, value); + } else if (!strcmp(subkey, "serveroption")) { + return parse_transport_option(key, value, + &remote->server_options); } return 0; } |
