allow suppressing of global and system config
[gitweb.git] / builtin-config.c
index e4a12e316648e6b0ab1ee0b424773f3c672c751e..404bb449aec1e24012b390b1d76f05d4cc9c74af 100644 (file)
@@ -79,9 +79,10 @@ static int get_value(const char* key_, const char* regex_)
                local = getenv(CONFIG_LOCAL_ENVIRONMENT);
                if (!local)
                        local = repo_config = xstrdup(git_path("config"));
-               if (home)
+               if (git_config_global() && home)
                        global = xstrdup(mkpath("%s/.gitconfig", home));
-               system_wide = git_etc_gitconfig();
+               if (git_config_system())
+                       system_wide = git_etc_gitconfig();
        }
 
        key = xstrdup(key_);