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;
}
/*