implement fetching of moved submodules
[gitweb.git] / color.c
diff --git a/color.c b/color.c
index dee61557e03f452f1e20ce6c8c467203aa8aed60..9c0dc823701d6aff0979659cd19ebb9c92f2eb8a 100644 (file)
--- a/color.c
+++ b/color.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "color.h"
 
 static int git_use_color_default = GIT_COLOR_AUTO;
@@ -307,7 +308,7 @@ int git_config_colorbool(const char *var, const char *value)
                if (!strcasecmp(value, "never"))
                        return 0;
                if (!strcasecmp(value, "always"))
-                       return 1;
+                       return var ? GIT_COLOR_AUTO : 1;
                if (!strcasecmp(value, "auto"))
                        return GIT_COLOR_AUTO;
        }
@@ -337,6 +338,13 @@ static int check_auto_color(void)
 
 int want_color(int var)
 {
+       /*
+        * NEEDSWORK: This function is sometimes used from multiple threads, and
+        * we end up using want_auto racily. That "should not matter" since
+        * we always write the same value, but it's still wrong. This function
+        * is listed in .tsan-suppressions for the time being.
+        */
+
        static int want_auto = -1;
 
        if (var < 0)
@@ -360,14 +368,6 @@ int git_color_config(const char *var, const char *value, void *cb)
        return 0;
 }
 
-int git_color_default_config(const char *var, const char *value, void *cb)
-{
-       if (git_color_config(var, value, cb) < 0)
-               return -1;
-
-       return git_default_config(var, value, cb);
-}
-
 void color_print_strbuf(FILE *fp, const char *color, const struct strbuf *sb)
 {
        if (*color)