git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuyu Wei <wsy@dogben.com>
To: git@vger.kernel.org
Cc: pyokagan@gmail.com, gitster@pobox.com
Subject: [PATCH] git-pull: Pass -4/-6 option to git-fetch
Date: Sun, 19 Nov 2017 19:01:32 +0800	[thread overview]
Message-ID: <20171119110132.folfzddhdorb6wqd@debian-dorm> (raw)

The -4/-6 option should be passed through to git-fetch
to be consistent with the git-pull man page.

Signed-off-by: Wei Shuyu <wsy@dogben.com>
---
 builtin/pull.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/builtin/pull.c b/builtin/pull.c
index f7e2c4f2e..166b777ed 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -113,6 +113,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 */
@@ -218,6 +220,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()
 };
@@ -522,6 +530,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);
-- 
2.15.0



             reply	other threads:[~2017-11-19 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 11:01 Shuyu Wei [this message]
2017-11-21  8:03 ` [PATCH] git-pull: Pass -4/-6 option to git-fetch Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2017-11-19 14:37 Shuyu Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171119110132.folfzddhdorb6wqd@debian-dorm \
    --to=wsy@dogben.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pyokagan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).