Functions use to read configuration from a repository */
| 2285 | |
| 2286 | /* Functions use to read configuration from a repository */ |
| 2287 | static 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 | |
| 2320 | static void git_config_check_init(struct repository *repo) |
| 2321 | { |
no test coverage detected