summaryrefslogtreecommitdiff
path: root/builtin/pull.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-06 17:09:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-06 17:09:00 (GMT)
commit0114a7ad0664358f6f29b44461148f621520ed97 (patch)
tree0713f43ee9d5f6c8a7e791c631a34535631d87a2 /builtin/pull.c
parent3cdea38707b6266b3bfa2bc5820f3f715f400d39 (diff)
parentffb4568afed7c3eaa20b000683bb82a761d8f717 (diff)
downloadgit-0114a7ad0664358f6f29b44461148f621520ed97.zip
git-0114a7ad0664358f6f29b44461148f621520ed97.tar.gz
git-0114a7ad0664358f6f29b44461148f621520ed97.tar.bz2
Merge branch 'sw/pull-ipv46-passthru' into maint
Contrary to the documentation, "git pull -4/-6 other-args" did not ask the underlying "git fetch" to go over IPv4/IPv6, which has been corrected. * sw/pull-ipv46-passthru: pull: pass -4/-6 option to 'git fetch'
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 4edab22..1b4d9cd 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -112,6 +112,8 @@ static char *opt_depth;
static char *opt_unshallow;
static char *opt_update_shallow;
static char *opt_refmap;
+static char *opt_ipv4;
+static char *opt_ipv6;
static struct option pull_options[] = {
/* Shared options */
@@ -214,6 +216,12 @@ static struct option pull_options[] = {
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
N_("specify fetch refmap"),
PARSE_OPT_NONEG),
+ OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
+ N_("use IPv4 addresses only"),
+ PARSE_OPT_NOARG),
+ OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
+ N_("use IPv6 addresses only"),
+ PARSE_OPT_NOARG),
OPT_END()
};
@@ -518,6 +526,10 @@ static int run_fetch(const char *repo, const char **refspecs)
argv_array_push(&args, opt_update_shallow);
if (opt_refmap)
argv_array_push(&args, opt_refmap);
+ if (opt_ipv4)
+ argv_array_push(&args, opt_ipv4);
+ if (opt_ipv6)
+ argv_array_push(&args, opt_ipv6);
if (repo) {
argv_array_push(&args, repo);