X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=color.c;h=9a9261ac164f503e2a9240806f4f44bedf9b8192;hb=a62f9d1ace8c6556cbc1bb7df69eff0a0bb9e774;hp=7aa8b076f045e5c0b74826153030e2923c0fc56e;hpb=8f3d48e14e7f15dd59592754416764db3060873d;p=thirdparty%2Fgit.git diff --git a/color.c b/color.c index 7aa8b076f0..9a9261ac16 100644 --- a/color.c +++ b/color.c @@ -338,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) @@ -361,6 +368,14 @@ 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)