| 381 | } |
| 382 | |
| 383 | enum git_colorbool git_config_colorbool(const char *var, const char *value) |
| 384 | { |
| 385 | if (value) { |
| 386 | if (!strcasecmp(value, "never")) |
| 387 | return GIT_COLOR_NEVER; |
| 388 | if (!strcasecmp(value, "always")) |
| 389 | return GIT_COLOR_ALWAYS; |
| 390 | if (!strcasecmp(value, "auto")) |
| 391 | return GIT_COLOR_AUTO; |
| 392 | } |
| 393 | |
| 394 | if (!var) |
| 395 | return GIT_COLOR_UNKNOWN; |
| 396 | |
| 397 | /* Missing or explicit false to turn off colorization */ |
| 398 | if (!git_config_bool(var, value)) |
| 399 | return GIT_COLOR_NEVER; |
| 400 | |
| 401 | /* any normal truth value defaults to 'auto' */ |
| 402 | return GIT_COLOR_AUTO; |
| 403 | } |
| 404 | |
| 405 | static bool check_auto_color(int fd) |
| 406 | { |
no test coverage detected