Skip to content

Commit c2b6135

Browse files
committed
Merge branch 'sw/pull-ipv46-passthru'
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 88e2efc + ffb4568 commit c2b6135

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
@@ -113,6 +113,8 @@ static char *opt_depth;
113113
static char *opt_unshallow;
114114
static char *opt_update_shallow;
115115
static char *opt_refmap;
116+
static char *opt_ipv4;
117+
static char *opt_ipv6;
116118

117119
static struct option pull_options[] = {
118120
/* Shared options */
@@ -218,6 +220,12 @@ static struct option pull_options[] = {
218220
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
219221
N_("specify fetch refmap"),
220222
PARSE_OPT_NONEG),
223+
OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
224+
N_("use IPv4 addresses only"),
225+
PARSE_OPT_NOARG),
226+
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
227+
N_("use IPv6 addresses only"),
228+
PARSE_OPT_NOARG),
221229

222230
OPT_END()
223231
};
@@ -522,6 +530,10 @@ static int run_fetch(const char *repo, const char **refspecs)
522530
argv_array_push(&args, opt_update_shallow);
523531
if (opt_refmap)
524532
argv_array_push(&args, opt_refmap);
533+
if (opt_ipv4)
534+
argv_array_push(&args, opt_ipv4);
535+
if (opt_ipv6)
536+
argv_array_push(&args, opt_ipv6);
525537

526538
if (repo) {
527539
argv_array_push(&args, repo);

0 commit comments

Comments
 (0)