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 <wsy@dogben.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shuyu Wei committed Nov 19, 2017 at 19:01 UTC ffb4568afed7c3eaa20b000683bb82a761d8f717
1 file changed +12
builtin/pull.c
+12
@@ -109,6 +109,8 @@ static char *opt_depth;
109 static char *opt_unshallow;
110 static char *opt_update_shallow;
111 static char *opt_refmap;
112 +static char *opt_ipv4;
113 +static char *opt_ipv6;
114
115 static struct option pull_options[] = {
116 /* Shared options */
@@ -211,6 +213,12 @@ static struct option pull_options[] = {
213 OPT_PASSTHRU(0, "refmap", &opt_refmap, N_("refmap"),
214 N_("specify fetch refmap"),
215 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),
222
223 OPT_END()
224 };
@@ -500,6 +508,10 @@ static int run_fetch(const char *repo, const char **refspecs)
508 argv_array_push(&args, opt_update_shallow);
509 if (opt_refmap)
510 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);
515
516 if (repo) {
517 argv_array_push(&args, repo);