summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorMatthias Kestenholz <mk@spinlock.ch>2008-02-18 08:26:03 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-18 00:00:38 -0800
commit6b2f2d9805dd22c6f74957e0d76a1d2921b40c16 (patch)
tree04abc994611f31c778738577db1e83bd9a979835 /wt-status.c
parentcf5c51efc9fe3b0ef93c7b78005c57b71acaf959 (diff)
downloadgit-6b2f2d9805dd22c6f74957e0d76a1d2921b40c16.tar.gz
Add color.ui variable which globally enables colorization if set
Signed-off-by: Matthias Kestenholz <mk@spinlock.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c
index 0b060934e2..32d780af1e 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -9,7 +9,7 @@
#include "diffcore.h"
int wt_status_relative_paths = 1;
-int wt_status_use_color = 0;
+int wt_status_use_color = -1;
static char wt_status_colors[][COLOR_MAXLEN] = {
"", /* WT_STATUS_HEADER: normal */
"\033[32m", /* WT_STATUS_UPDATED: green */
@@ -40,7 +40,7 @@ static int parse_status_slot(const char *var, int offset)
static const char* color(int slot)
{
- return wt_status_use_color ? wt_status_colors[slot] : "";
+ return wt_status_use_color > 0 ? wt_status_colors[slot] : "";
}
void wt_status_prepare(struct wt_status *s)
@@ -401,5 +401,5 @@ int git_status_config(const char *k, const char *v)
wt_status_relative_paths = git_config_bool(k, v);
return 0;
}
- return git_default_config(k, v);
+ return git_color_default_config(k, v);
}