mirror of
https://github.com/git/git.git
synced 2026-03-19 21:20:05 +01:00
Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -159,7 +159,7 @@ static int get_value(const char *key_, const char *regex_)
|
||||
|
||||
local = config_exclusive_filename;
|
||||
if (!local) {
|
||||
const char *home = getenv("HOME");
|
||||
const char *home = get_home_directory();
|
||||
local = repo_config = git_pathdup("config");
|
||||
if (git_config_global() && home)
|
||||
global = xstrdup(mkpath("%s/.gitconfig", home));
|
||||
@@ -348,7 +348,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
|
||||
}
|
||||
|
||||
if (use_global_config) {
|
||||
char *home = getenv("HOME");
|
||||
char *home = get_home_directory();
|
||||
if (home) {
|
||||
char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
|
||||
config_exclusive_filename = user_config;
|
||||
|
||||
Reference in New Issue
Block a user