parse-options: introduce OPT_IPVERSION()
commitae2c912c04cf9902653409d686ca6d5017c3906f
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 21:34:33 +0000 (18 14:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 21:35:54 +0000 (18 14:35 -0700)
tree58403847c08a56733b7e261fbc8363184e3fa1de
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
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>
builtin/clone.c
builtin/fetch.c
builtin/push.c
parse-options.h