From: Alex Riesen Date: Tue, 15 Sep 2020 11:54:07 +0000 (+0200) Subject: fetch: pass --ipv4 and --ipv6 options to sub-fetches X-Git-Tag: v2.29.0-rc0~49^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e735c13267e65f8c37fc3e7dfaacb36e5d51ab8;p=thirdparty%2Fgit.git fetch: pass --ipv4 and --ipv6 options to sub-fetches The options indicate user intent for the whole fetch operation, and ignoring them in sub-fetches (i.e. "--all" and recursive fetching of submodules) is quite unexpected when, for instance, it is intended to limit all of the communication to a specific transport protocol for some reason. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/builtin/fetch.c b/builtin/fetch.c index 82ac4be8a5..447d28ac29 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1531,6 +1531,10 @@ static void add_options_to_argv(struct argv_array *argv) argv_array_push(argv, "-v"); else if (verbosity < 0) argv_array_push(argv, "-q"); + if (family == TRANSPORT_FAMILY_IPV4) + argv_array_push(argv, "--ipv4"); + else if (family == TRANSPORT_FAMILY_IPV6) + argv_array_push(argv, "--ipv6"); }