| 1610 | } |
| 1611 | |
| 1612 | int config_with_options(config_fn_t fn, void *data, |
| 1613 | const struct git_config_source *config_source, |
| 1614 | struct repository *repo, |
| 1615 | const struct config_options *opts) |
| 1616 | { |
| 1617 | struct config_include_data inc = CONFIG_INCLUDE_INIT; |
| 1618 | int ret; |
| 1619 | |
| 1620 | if (opts->respect_includes) { |
| 1621 | inc.fn = fn; |
| 1622 | inc.data = data; |
| 1623 | inc.opts = opts; |
| 1624 | inc.repo = repo; |
| 1625 | inc.config_source = config_source; |
| 1626 | fn = git_config_include; |
| 1627 | data = &inc; |
| 1628 | } |
| 1629 | |
| 1630 | /* |
| 1631 | * If we have a specific filename, use it. Otherwise, follow the |
| 1632 | * regular lookup sequence. |
| 1633 | */ |
| 1634 | if (config_source && config_source->use_stdin) { |
| 1635 | ret = git_config_from_stdin(fn, data, config_source->scope); |
| 1636 | } else if (config_source && config_source->file) { |
| 1637 | ret = git_config_from_file_with_options(fn, config_source->file, |
| 1638 | data, config_source->scope, |
| 1639 | NULL); |
| 1640 | } else if (config_source && config_source->blob) { |
| 1641 | ret = git_config_from_blob_ref(fn, repo, config_source->blob, |
| 1642 | data, config_source->scope); |
| 1643 | } else { |
| 1644 | ret = do_git_config_sequence(opts, repo, fn, data); |
| 1645 | } |
| 1646 | |
| 1647 | if (inc.remote_urls) { |
| 1648 | string_list_clear(inc.remote_urls, 0); |
| 1649 | FREE_AND_NULL(inc.remote_urls); |
| 1650 | } |
| 1651 | return ret; |
| 1652 | } |
| 1653 | |
| 1654 | static void configset_iter(struct config_set *set, config_fn_t fn, void *data) |
| 1655 | { |
no test coverage detected