Skip to content

Commit

Permalink
git config: don't allow --get-color* and variable type
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Feb 22, 2009
1 parent 225a9ca commit c238735
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c238735

Please sign in to comment.