mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-29 13:48:07 -05:00
fixup! Windows: add support for a Windows-wide configuration
Let's avoid the triple function call; We can just store the result and use it three times instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
15
config.c
15
config.c
@@ -1678,14 +1678,13 @@ static int do_git_config_sequence(const struct config_options *opts,
|
||||
current_parsing_scope = CONFIG_SCOPE_SYSTEM;
|
||||
if (git_config_system()) {
|
||||
int flags = opts->system_gently ? ACCESS_EACCES_OK : 0;
|
||||
if (git_program_data_config() &&
|
||||
!access_or_die(git_program_data_config(), R_OK, flags))
|
||||
ret += git_config_from_file(fn,
|
||||
git_program_data_config(),
|
||||
data);
|
||||
if (!access_or_die(git_etc_gitconfig(), R_OK, flags))
|
||||
ret += git_config_from_file(fn, git_etc_gitconfig(),
|
||||
data);
|
||||
const char *program_data = git_program_data_config();
|
||||
const char *etc = git_etc_gitconfig();
|
||||
|
||||
if (program_data && !access_or_die(program_data, R_OK, flags))
|
||||
ret += git_config_from_file(fn, program_data, data);
|
||||
if (!access_or_die(etc, R_OK, flags))
|
||||
ret += git_config_from_file(fn, etc, data);
|
||||
}
|
||||
|
||||
current_parsing_scope = CONFIG_SCOPE_GLOBAL;
|
||||
|
||||
Reference in New Issue
Block a user