summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-24 21:25:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-24 21:25:54 (GMT)
commite84d5e9fa178a027b1c8b9f6e22c9173dcda03b3 (patch)
treeb3d16c3076cb8bce048c54e331e86f56e0c0533b /builtin/clone.c
parent8020803f5057601c1c29ffcdbd309905bd26eef7 (diff)
parentc915f11eb4922e154e29cf62d3b549d65c06a170 (diff)
downloadgit-e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3.zip
git-e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3.tar.gz
git-e84d5e9fa178a027b1c8b9f6e22c9173dcda03b3.tar.bz2
Merge branch 'ew/force-ipv4'
"git fetch" and friends that make network connections can now be told to only use ipv4 (or ipv6). * ew/force-ipv4: connect & http: support -4 and -6 switches for remote operations
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index bcba080..b8c39aa 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -47,6 +47,7 @@ static const char *real_git_dir;
static char *option_upload_pack = "git-upload-pack";
static int option_verbosity;
static int option_progress = -1;
+static enum transport_family family;
static struct string_list option_config;
static struct string_list option_reference;
static int option_dissociate;
@@ -92,6 +93,10 @@ static struct option builtin_clone_options[] = {
N_("separate git dir from working tree")),
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),
N_("set config inside the new repository")),
+ OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
+ TRANSPORT_FAMILY_IPV4),
+ OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
+ TRANSPORT_FAMILY_IPV6),
OPT_END()
};
@@ -970,6 +975,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
remote = remote_get(option_origin);
transport = transport_get(remote, remote->url[0]);
transport_set_verbosity(transport, option_verbosity, option_progress);
+ transport->family = family;
path = get_repo_path(remote->url[0], &is_bundle);
is_local = option_local != 0 && path && !is_bundle;