fixup! Windows: add support for a Windows-wide configuration

This fixes https://github.com/git-for-windows/git/issues/168.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2015-05-29 11:12:17 +02:00
parent 18583f5f8c
commit d32afb6793

View File

@@ -2665,10 +2665,13 @@ const char *program_data_config(void)
if (!initialized) {
const char *env = mingw_getenv("PROGRAMDATA");
if (!env)
const char *extra = "";
if (!env) {
env = mingw_getenv("ALLUSERSPROFILE");
extra = "/Application Data";
}
if (env)
strbuf_addf(&path, "%s/Git/config", env);
strbuf_addf(&path, "%s%s/Git/config", env, extra);
initialized = 1;
}
return *path.buf ? path.buf : NULL;