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

Function repo_read_config

config.c:2287–2318  ·  view source on GitHub ↗

Functions use to read configuration from a repository */

Source from the content-addressed store, hash-verified

2285
2286/* Functions use to read configuration from a repository */
2287static void repo_read_config(struct repository *repo)
2288{
2289 struct config_options opts = { 0 };
2290 struct repo_config config = REPO_CONFIG_INIT(repo);
2291
2292 opts.respect_includes = 1;
2293 opts.commondir = repo->commondir;
2294 opts.git_dir = repo->gitdir;
2295
2296 if (!repo->config)
2297 CALLOC_ARRAY(repo->config, 1);
2298 else
2299 git_configset_clear(repo->config);
2300
2301 git_configset_init(repo->config);
2302 if (config_with_options(repo_config_callback, &config, NULL, repo,
2303 &opts) < 0)
2304 /*
2305 * config_with_options() normally returns only
2306 * zero, as most errors are fatal, and
2307 * non-fatal potential errors are guarded by "if"
2308 * statements that are entered only when no error is
2309 * possible.
2310 *
2311 * If we ever encounter a non-fatal error, it means
2312 * something went really wrong and we should stop
2313 * immediately.
2314 */
2315 die(_("unknown error occurred while reading the configuration files"));
2316 check_deprecated_config(&config);
2317 repo_config_release(&config);
2318}
2319
2320static void git_config_check_init(struct repository *repo)
2321{

Callers 1

git_config_check_initFunction · 0.85

Calls 6

git_configset_clearFunction · 0.85
git_configset_initFunction · 0.85
config_with_optionsFunction · 0.85
check_deprecated_configFunction · 0.85
repo_config_releaseFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected