| 482 | }; |
| 483 | |
| 484 | static int git_trailer_default_config(const char *conf_key, const char *value, |
| 485 | const struct config_context *ctx UNUSED, |
| 486 | void *cb UNUSED) |
| 487 | { |
| 488 | const char *trailer_item, *variable_name; |
| 489 | |
| 490 | if (!skip_prefix(conf_key, "trailer.", &trailer_item)) |
| 491 | return 0; |
| 492 | |
| 493 | variable_name = strrchr(trailer_item, '.'); |
| 494 | if (!variable_name) { |
| 495 | if (!strcmp(trailer_item, "where")) { |
| 496 | if (trailer_set_where(&default_conf_info.where, |
| 497 | value) < 0) |
| 498 | warning(_("unknown value '%s' for key '%s'"), |
| 499 | value, conf_key); |
| 500 | } else if (!strcmp(trailer_item, "ifexists")) { |
| 501 | if (trailer_set_if_exists(&default_conf_info.if_exists, |
| 502 | value) < 0) |
| 503 | warning(_("unknown value '%s' for key '%s'"), |
| 504 | value, conf_key); |
| 505 | } else if (!strcmp(trailer_item, "ifmissing")) { |
| 506 | if (trailer_set_if_missing(&default_conf_info.if_missing, |
| 507 | value) < 0) |
| 508 | warning(_("unknown value '%s' for key '%s'"), |
| 509 | value, conf_key); |
| 510 | } else if (!strcmp(trailer_item, "separators")) { |
| 511 | if (!value) |
| 512 | return config_error_nonbool(conf_key); |
| 513 | separators = xstrdup(value); |
| 514 | } |
| 515 | } |
| 516 | return 0; |
| 517 | } |
| 518 | |
| 519 | static int git_trailer_config(const char *conf_key, const char *value, |
| 520 | const struct config_context *ctx UNUSED, |
nothing calls this directly
no test coverage detected