log: teach "terminator" vs "separator" mode to "--pretty=format"
[gitweb.git] / builtin-config.c
index 077d8ef2df4ae38d668293cc35810b39e0488f6b..c34bc8b6a6957ccee1db23a3c44c99e058384689 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_);
@@ -263,7 +264,7 @@ static int get_colorbool(int argc, const char **argv)
 
 int cmd_config(int argc, const char **argv, const char *prefix)
 {
-       int nongit = 0;
+       int nongit;
        char* value;
        const char *file = setup_git_directory_gently(&nongit);