Skip to content

Commit ffb4568

Browse files
wsy2220gitster
authored andcommitted
pull: pass -4/-6 option to 'git fetch'
The -4/-6 option should be passed through to 'git fetch' to be consistent with the man page. Signed-off-by: Wei Shuyu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42e6fde commit ffb4568

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
@@ -109,6 +109,8 @@ static char *opt_depth;
109109
static char *opt_unshallow;
110110
static char *opt_update_shallow;
111111
static char *opt_refmap;
112+
static char *opt_ipv4;
113+
static char *opt_ipv6;
112114

113115
static struct option pull_options[] = {
114116
/* Shared options */
@@ -211,6 +213,12 @@ static struct option pull_options[] = {
211213
OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
212214
N_("specify fetch refmap"),
213215
PARSE_OPT_NONEG),
216+
OPT_PASSTHRU('4', "ipv4", &opt_ipv4, NULL,
217+
N_("use IPv4 addresses only"),
218+
PARSE_OPT_NOARG),
219+
OPT_PASSTHRU('6', "ipv6", &opt_ipv6, NULL,
220+
N_("use IPv6 addresses only"),
221+
PARSE_OPT_NOARG),
214222

215223
OPT_END()
216224
};
@@ -500,6 +508,10 @@ static int run_fetch(const char *repo, const char **refspecs)
500508
argv_array_push(&args, opt_update_shallow);
501509
if (opt_refmap)
502510
argv_array_push(&args, opt_refmap);
511+
if (opt_ipv4)
512+
argv_array_push(&args, opt_ipv4);
513+
if (opt_ipv6)
514+
argv_array_push(&args, opt_ipv6);
503515

504516
if (repo) {
505517
argv_array_push(&args, repo);

0 commit comments

Comments
 (0)