MCPcopy Create free account
hub / github.com/git/git / read_early_config

Function read_early_config

config.c:1675–1703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1673}
1674
1675void read_early_config(struct repository *repo, config_fn_t cb, void *data)
1676{
1677 struct config_options opts = {0};
1678 struct strbuf commondir = STRBUF_INIT;
1679 struct strbuf gitdir = STRBUF_INIT;
1680
1681 opts.respect_includes = 1;
1682
1683 if (repo && repo->gitdir) {
1684 opts.commondir = repo_get_common_dir(repo);
1685 opts.git_dir = repo_get_git_dir(repo);
1686 /*
1687 * When setup_git_directory() was not yet asked to discover the
1688 * GIT_DIR, we ask discover_git_directory() to figure out whether there
1689 * is any repository config we should use (but unlike
1690 * setup_git_directory_gently(), no global state is changed, most
1691 * notably, the current working directory is still the same after the
1692 * call).
1693 */
1694 } else if (!discover_git_directory(&commondir, &gitdir)) {
1695 opts.commondir = commondir.buf;
1696 opts.git_dir = gitdir.buf;
1697 }
1698
1699 config_with_options(cb, data, NULL, NULL, &opts);
1700
1701 strbuf_release(&commondir);
1702 strbuf_release(&gitdir);
1703}
1704
1705void read_very_early_config(config_fn_t cb, void *data)
1706{

Callers 7

help_unknown_cmdFunction · 0.85
git_pagerFunction · 0.85
check_pager_configFunction · 0.85
alias_lookupFunction · 0.85
list_aliasesFunction · 0.85
tr2_cfg_list_config_flFunction · 0.85
cmd__configFunction · 0.85

Calls 5

repo_get_common_dirFunction · 0.85
repo_get_git_dirFunction · 0.85
discover_git_directoryFunction · 0.85
config_with_optionsFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by 1

cmd__configFunction · 0.68