]> Kevux Git Server - rit/commit
config: use an enum for type
authorDerrick Stolee <stolee@gmail.com>
Mon, 23 Feb 2026 12:26:55 +0000 (12:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Feb 2026 21:23:41 +0000 (13:23 -0800)
commit096aa6099834ce00401a369b34cbff4868ea5704
tree8a97fb742a3f6c0f8aba9ec6844954cd6b08cc11
parent645f92a3e9179ebf1ed42dc4fa05cc8dd71e3e9c
config: use an enum for type

The --type=<X> option for 'git config' has previously been defined using
macros, but using a typed enum is better for tracking the possible
values.

Move the definition up to make sure it is defined before a macro uses
some of its terms.

Update the initializer for config_display_options to explicitly set
'type' to TYPE_NONE even though this is implied by a zero value.

This assists in knowing that the switch statement added in the previous
change has a complete set of cases for a properly-valued enum.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c