summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorLibravatar Paolo Bonzini <pbonzini@redhat.com>2020-02-20 15:15:16 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-02-20 13:20:40 -0800
commitbc8620b44094e9fb6fc20d141678f9b845c19193 (patch)
treea2120bed53eaf4ae3028c1dab988b3428fb5661e /upload-pack.c
parentparse-options: add testcases for OPT_CMDMODE() (diff)
downloadtgif-bc8620b44094e9fb6fc20d141678f9b845c19193.tar.xz
parse-options: convert "command mode" to a flag
OPTION_CMDMODE is essentially OPTION_SET_INT plus an extra check that the variable had not set before. In order to allow custom processing of the option, for example a "command mode" option that also has an argument, it would be nice to use OPTION_CALLBACK and not have to rewrite the extra check on incompatible options. In other words, making the processing of the option orthogonal to the "only one of these" behavior provided by OPTION_CMDMODE. Add a new flag that takes care of the check, and modify OPT_CMDMODE to use it together with OPTION_SET_INT. The new flag still requires that the option value points to an int, but any OPTION_* value can be specified as long as it does not require a non-int type for opt->value. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
0 files changed, 0 insertions, 0 deletions