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:
Johannes Schindelin
2010-06-02 00:41:33 +02:00
parent 1a525079e7
commit 1927dd072e
6 changed files with 29 additions and 4 deletions

View File

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