| 286 | }; |
| 287 | |
| 288 | static void init_color(struct repository *r, |
| 289 | enum git_colorbool use_color, |
| 290 | const char *section_and_slot, char *dst, |
| 291 | const char *default_color) |
| 292 | { |
| 293 | char *key = xstrfmt("color.%s", section_and_slot); |
| 294 | const char *value; |
| 295 | |
| 296 | if (!want_color(use_color)) |
| 297 | dst[0] = '\0'; |
| 298 | else if (repo_config_get_value(r, key, &value) || |
| 299 | color_parse(value, dst)) |
| 300 | strlcpy(dst, default_color, COLOR_MAXLEN); |
| 301 | |
| 302 | free(key); |
| 303 | } |
| 304 | |
| 305 | static enum git_colorbool check_color_config(struct repository *r, const char *var) |
| 306 | { |
no test coverage detected