Skip to content

Commit 0114a7a

Browse files
committed
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'
2 parents 3cdea38 + ffb4568 commit 0114a7a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

builtin/pull.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ static char *opt_depth;
112112
static char *opt_unshallow;
113113
static char *opt_update_shallow;
114114
static char *opt_refmap;
115+
static char *opt_ipv4;
116+
static char *opt_ipv6;
115117

116118
static struct option pull_options[] = {
117119
/* Shared options */
@@ -214,6 +216,12 @@ static struct option pull_options[] = {
214216
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
215217
N_("specify fetch refmap"),
216218
PARSE_OPT_NONEG),
219+
OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
220+
N_("use IPv4 addresses only"),
221+
PARSE_OPT_NOARG),
222+
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
223+
N_("use IPv6 addresses only"),
224+
PARSE_OPT_NOARG),
217225

218226
OPT_END()
219227
};
@@ -518,6 +526,10 @@ static int run_fetch(const char *repo, const char **refspecs)
518526
argv_array_push(&args, opt_update_shallow);
519527
if (opt_refmap)
520528
argv_array_push(&args, opt_refmap);
529+
if (opt_ipv4)
530+
argv_array_push(&args, opt_ipv4);
531+
if (opt_ipv6)
532+
argv_array_push(&args, opt_ipv6);
521533

522534
if (repo) {
523535
argv_array_push(&args, repo);

0 commit comments

Comments
 (0)