| 303 | } |
| 304 | |
| 305 | static enum git_colorbool check_color_config(struct repository *r, const char *var) |
| 306 | { |
| 307 | const char *value; |
| 308 | enum git_colorbool ret; |
| 309 | |
| 310 | if (repo_config_get_value(r, var, &value)) |
| 311 | ret = GIT_COLOR_UNKNOWN; |
| 312 | else |
| 313 | ret = git_config_colorbool(var, value); |
| 314 | |
| 315 | /* |
| 316 | * Do not rely on want_color() to fall back to color.ui for us. It uses |
| 317 | * the value parsed by git_color_config(), which may not have been |
| 318 | * called by the main command. |
| 319 | */ |
| 320 | if (ret == GIT_COLOR_UNKNOWN && |
| 321 | !repo_config_get_value(r, "color.ui", &value)) |
| 322 | ret = git_config_colorbool("color.ui", value); |
| 323 | |
| 324 | return ret; |
| 325 | } |
| 326 | |
| 327 | void interactive_config_init(struct interactive_config *cfg, |
| 328 | struct repository *r, |
no test coverage detected