aboutsummaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-08-17 22:03:48 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-18 14:48:29 -0700
commite269eb7946d0a4ba6a4e175133b5479446ac04a5 (patch)
tree65da98cebb4776458fa7944ba7101c2f4149f1f7 /builtin/grep.c
parentf1c9626105d5e4962a5ccaa4620114d03f32ad02 (diff)
downloadgit-e269eb7946d0a4ba6a4e175133b5479446ac04a5.tar.gz
git-e269eb7946d0a4ba6a4e175133b5479446ac04a5.tar.xz
git_config_colorbool: refactor stdout_is_tty handling
Usually this function figures out for itself whether stdout is a tty. However, it has an extra parameter just to allow git-config to override the auto-detection for its --get-colorbool option. Instead of an extra parameter, let's just use a global variable. This makes calling easier in the common case, and will make refactoring the colorbool code much simpler. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 871afaa3c..c17d7de56 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -316,7 +316,7 @@ static int grep_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "color.grep"))
- opt->color = git_config_colorbool(var, value, -1);
+ opt->color = git_config_colorbool(var, value);
else if (!strcmp(var, "color.grep.context"))
color = opt->color_context;
else if (!strcmp(var, "color.grep.filename"))