summaryrefslogtreecommitdiff
path: root/builtin-config.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2009-02-21 02:49:29 +0200
committerJunio C Hamano <gitster@pobox.com>2009-02-21 20:37:48 -0800
commitc23873589483eb5dc753190309af8c5821169118 (patch)
tree476b491ed96bc8f433d951970d826e4a6bb781e7 /builtin-config.c
parent225a9caf18911bffe2f32e4960c94e51f135182b (diff)
downloadgit-c23873589483eb5dc753190309af8c5821169118.tar.gz
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 <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-config.c')
-rw-r--r--builtin-config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-config.c b/builtin-config.c
index a3a334bc63..b11a0961bd 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);