]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fetch: pass --ipv4 and --ipv6 options to sub-fetches
authorAlex Riesen <alexander.riesen@cetitec.com>
Tue, 15 Sep 2020 11:54:07 +0000 (13:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Sep 2020 21:15:05 +0000 (14:15 -0700)
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 <alexander.riesen@cetitec.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c

index 82ac4be8a5200c7f6ac89c07cb486ac74f548ea3..447d28ac29cbe72e1407359c90207d7d7797b90b 100644 (file)
@@ -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");
 
 }