X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=config.c;fp=config.c;h=bbd3ff2956eccd6b522b8475e6d3edb00d2ff59a;hb=ea71d197c3d265f32aae225a5fd17f4ef617c216;hp=c47497001e172060abdcd08e4a606bec89303232;hpb=41292ddd37202ff6dce34986c87a6000c5d3fbfa;p=git.git diff --git a/config.c b/config.c index c4749700..bbd3ff29 100644 --- a/config.c +++ b/config.c @@ -317,7 +317,18 @@ int git_config_from_file(config_fn_t fn, const char *filename) int git_config(config_fn_t fn) { - return git_config_from_file(fn, git_path("config")); + int ret = 0; + const char *home = getenv("HOME"); + + if (home) { + ret = git_config_from_file(fn, mkpath("%s/.gitconfig", home)); + /* ignore if global config does not exist */ + if (ret < 0) + ret = 0; + } + + ret += git_config_from_file(fn, git_path("config")); + return ret; } /*