mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
color: return enum from git_config_colorbool()
The git_config_colorbool() function returns an integer which is always one of the GIT_COLOR_* constants UNKNOWN, NEVER, ALWAYS, or AUTO. We define these constants with macros, but let's switch to using an enum. Even though the compiler does not strictly enforce enum/int conversions, this should make the intent clearer to human readers. And as a bonus, enum names are typically available to debuggers, making it more pleasant to step through the code there. This patch updates the return type of git_config_colorbool(), but holds off on updating all of the callers. There's some trickiness to some of them, and in the meantime it's perfectly fine to assign an enum into an int. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3c3e9b8303
commit
53e8a435ba
Reference in New Issue
Block a user