Browse Source

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>
maint
Felipe Contreras 16 years ago committed by Junio C Hamano
parent
commit
c238735894
  1. 5
      builtin-config.c

5
builtin-config.c

@ -360,6 +360,11 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix) @@ -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);

Loading…
Cancel
Save