diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-19 00:34:33 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-19 00:35:54 +0300 |
commit | ae2c912c04cf9902653409d686ca6d5017c3906f (patch) | |
tree | 58403847c08a56733b7e261fbc8363184e3fa1de /builtin/push.c | |
parent | fb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff) |
parse-options: introduce OPT_IPVERSION()
The command line option parsing for "git clone", "git fetch", and
"git push" have duplicated implementations of parsing "--ipv4" and
"--ipv6" options, by having two OPT_SET_INT() for "ipv4" and "ipv6".
Introduce a new OPT_IPVERSION() macro and use it in these three
commands.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/push.c')
-rw-r--r-- | builtin/push.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/push.c b/builtin/push.c index dbdf609daf..aa28fdba0e 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() }; |