MCPcopy Index your code
hub / github.com/git/git / config_with_options

Function config_with_options

config.c:1612–1652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1610}
1611
1612int 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
1654static void configset_iter(struct config_set *set, config_fn_t fn, void *data)
1655{

Callers 13

populate_remote_urlsFunction · 0.85
read_early_configFunction · 0.85
read_very_early_configFunction · 0.85
repo_read_configFunction · 0.85
read_protected_configFunction · 0.85
config_from_gitmodulesFunction · 0.85
get_valueFunction · 0.85
get_colorFunction · 0.85
get_colorboolFunction · 0.85
get_urlmatchFunction · 0.85
cmd_config_listFunction · 0.85

Calls 5

git_config_from_stdinFunction · 0.85
git_config_from_blob_refFunction · 0.85
do_git_config_sequenceFunction · 0.85
string_list_clearFunction · 0.85

Tested by

no test coverage detected