Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-28 01:26:37 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-28 01:26:37 +0300
commit9562f19026f1dcdfcfda86c2c9b7cff21c8b0642 (patch)
tree37fe37bad4646cadfdda68b22a4ec8ee1288cbcd /builtin
parent7fb1483c27f367e5654e6f23586de58a30be6025 (diff)
parenta2dad4868bf0681f63fe10264c171b5a547324a5 (diff)
Merge branch 'jc/transport-parseopt-fix'
Command line parser fixes. * jc/transport-parseopt-fix: fetch: reject --no-ipv[46] parse-options: introduce OPT_IPVERSION()
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c5
-rw-r--r--builtin/fetch.c5
-rw-r--r--builtin/push.c5
3 files changed, 3 insertions, 12 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index c65378b3d2..c6357af949 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -161,10 +161,7 @@ static struct option builtin_clone_options[] = {
N_("set config inside the new repository")),
OPT_STRING_LIST(0, "server-option", &server_options,
N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
+ OPT_IPVERSION(&family),
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
OPT_BOOL(0, "also-filter-submodules", &option_filter_submodules,
N_("apply partial clone filters to submodules")),
diff --git a/builtin/fetch.c b/builtin/fetch.c
index a01ecad574..eed4a7cdb6 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2207,10 +2207,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
OPT_CALLBACK_F(0, "refmap", NULL, N_("refmap"),
N_("specify fetch refmap"), PARSE_OPT_NONEG, parse_refmap_arg),
OPT_STRING_LIST('o', "server-option", &server_options, N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
+ OPT_IPVERSION(&family),
OPT_STRING_LIST(0, "negotiation-tip", &negotiation_tip, N_("revision"),
N_("report that we have only objects reachable from this object")),
OPT_BOOL(0, "negotiate-only", &negotiate_only,
diff --git a/builtin/push.c b/builtin/push.c
index f05d2e29bc..2e708383c2 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -627,10 +627,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
PARSE_OPT_OPTARG, option_parse_push_signed),
OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
OPT_STRING_LIST('o', "push-option", &push_options_cmdline, N_("server-specific"), N_("option to transmit")),
- OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"),
- TRANSPORT_FAMILY_IPV4),
- OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
- TRANSPORT_FAMILY_IPV6),
+ OPT_IPVERSION(&family),
OPT_END()
};