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:
Johannes Schindelin
2019-05-20 13:51:36 +02:00
parent 202835b08a
commit abc9ea65bc

View File

@@ -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;