| 618 | } |
| 619 | |
| 620 | static int config_parse_pair(const char *key, const char *value, |
| 621 | struct key_value_info *kvi, |
| 622 | config_fn_t fn, void *data) |
| 623 | { |
| 624 | char *canonical_name; |
| 625 | int ret; |
| 626 | struct config_context ctx = { |
| 627 | .kvi = kvi, |
| 628 | }; |
| 629 | |
| 630 | if (!strlen(key)) |
| 631 | return error(_("empty config key")); |
| 632 | if (git_config_parse_key(key, &canonical_name, NULL)) |
| 633 | return -1; |
| 634 | |
| 635 | ret = (fn(canonical_name, value, &ctx, data) < 0) ? -1 : 0; |
| 636 | free(canonical_name); |
| 637 | return ret; |
| 638 | } |
| 639 | |
| 640 | |
| 641 | /* for values read from `git_config_from_parameters()` */ |
no test coverage detected