@matheusbsbs / matheus-bagliano / commits / c238735894
Fork 0

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>

Felipe Contreras committed Feb 21, 2009 at 02:49 UTC c23873589483eb5dc753190309af8c5821169118
1 file changed +5
builtin-config.c
+5
@@ -360,6 +360,11 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
360 if (get_colorbool_slot)
361 actions |= ACTION_GET_COLORBOOL;
362
363 + if ((get_color_slot || get_colorbool_slot) && types) {
364 + error("--get-color and variable type are incoherent");
365 + usage_with_options(builtin_config_usage, builtin_config_options);
366 + }
367 +
368 if (HAS_MULTI_BITS(actions)) {
369 error("only one action at a time.");
370 usage_with_options(builtin_config_usage, builtin_config_options);