Code

git format-patch: avoid underrun when format.headers is empty or all NLs
[git.git] / color.c
diff --git a/color.c b/color.c
index cb70340420b6285786b988d4a98d2023a37d4ffc..fc0b72ad59b13e4bd86372e5e81b4f400c99d26e 100644 (file)
--- a/color.c
+++ b/color.c
@@ -3,6 +3,8 @@
 
 #define COLOR_RESET "\033[m"
 
+int git_use_color_default = 0;
+
 static int parse_color(const char *name, int len)
 {
        static const char * const color_names[] = {
@@ -143,6 +145,16 @@ int git_config_colorbool(const char *var, const char *value, int stdout_is_tty)
        return 0;
 }
 
+int git_color_default_config(const char *var, const char *value, void *cb)
+{
+       if (!strcmp(var, "color.ui")) {
+               git_use_color_default = git_config_colorbool(var, value, -1);
+               return 0;
+       }
+
+       return git_default_config(var, value, cb);
+}
+
 static int color_vfprintf(FILE *fp, const char *color, const char *fmt,
                va_list args, const char *trail)
 {