Merge branch 'mm/color-auto-default'
[gitweb.git] / builtin / config.c
index 19ffcaf18776e8b100ee3f57c7ca7447436c5476..7759671eb8d44ad341831eeffc96c4469d0652e8 100644 (file)
@@ -329,6 +329,7 @@ static int get_colorbool(int print)
 {
        get_colorbool_found = -1;
        get_diff_color_found = -1;
+       get_color_ui_found = -1;
        git_config_with_options(git_get_colorbool_config, NULL,
                                given_config_file, respect_includes);
 
@@ -339,6 +340,10 @@ static int get_colorbool(int print)
                        get_colorbool_found = get_color_ui_found;
        }
 
+       if (get_colorbool_found < 0)
+               /* default value if none found in config */
+               get_colorbool_found = GIT_COLOR_AUTO;
+
        get_colorbool_found = want_color(get_colorbool_found);
 
        if (print) {