summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorAlex Riesen <alexander.riesen@cetitec.com>2020-09-15 11:54:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-15 21:15:05 (GMT)
commit4e735c13267e65f8c37fc3e7dfaacb36e5d51ab8 (patch)
tree341a2ea267fae461271f17cd8d5ab09e5d0e2542 /builtin/fetch.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
downloadgit-4e735c13267e65f8c37fc3e7dfaacb36e5d51ab8.zip
git-4e735c13267e65f8c37fc3e7dfaacb36e5d51ab8.tar.gz
git-4e735c13267e65f8c37fc3e7dfaacb36e5d51ab8.tar.bz2
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>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 82ac4be..447d28a 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");
}