From: Felipe Contreras Date: Sat, 21 Feb 2009 00:49:29 +0000 (+0200) Subject: git config: don't allow --get-color* and variable type X-Git-Tag: v1.6.3-rc0~126^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;ds=sidebyside;h=c23873589483eb5dc753190309af8c5821169118;p=git.git git config: don't allow --get-color* and variable type Doing so would be incoherent since --get-color would pick a color slot and ignore the variable type option (e.g. --bool), and the type would require a variable name. Suggested by Junio C Hamano. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- diff --git a/builtin-config.c b/builtin-config.c index a3a334bc6..b11a0961b 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -360,6 +360,11 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix) if (get_colorbool_slot) actions |= ACTION_GET_COLORBOOL; + if ((get_color_slot || get_colorbool_slot) && types) { + error("--get-color and variable type are incoherent"); + usage_with_options(builtin_config_usage, builtin_config_options); + } + if (HAS_MULTI_BITS(actions)) { error("only one action at a time."); usage_with_options(builtin_config_usage, builtin_config_options);