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 <alexander.riesen@cetitec.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen 2020-09-15 13:54:07 +02:00 committed by Junio C Hamano
parent 47ae905ffb
commit 4e735c1326

View 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");
}