mirror of
https://github.com/git/git.git
synced 2026-02-11 02:08:39 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user