summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-28 21:19:16 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-28 21:19:16 -0700
commitf946b465d7fa13a235dd5653d37c7babb1ceb233 (patch)
treed3a1aa2e6f0779e5440cec0815f0d59d9e31b4d4 /grep.c
parente5cfcb04e0acc5f3b51e6d69487028315b33e4c9 (diff)
parentc9bfb953489e559d513c1627150aa16f8d42d6c5 (diff)
downloadgit-f946b465d7fa13a235dd5653d37c7babb1ceb233.tar.gz
Merge branch 'jk/color-and-pager'
* jk/color-and-pager: want_color: automatically fallback to color.ui diff: don't load color config in plumbing config: refactor get_colorbool function color: delay auto-color decision until point of use git_config_colorbool: refactor stdout_is_tty handling diff: refactor COLOR_DIFF from a flag into an int setup_pager: set GIT_PAGER_IN_USE t7006: use test_config helpers test-lib: add helper functions for config t7006: modernize calls to unset Conflicts: builtin/commit.c parse-options.c
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/grep.c b/grep.c
index 26e8d8ec4c..2dd2a25ad7 100644
--- a/grep.c
+++ b/grep.c
@@ -430,7 +430,7 @@ static int word_char(char ch)
static void output_color(struct grep_opt *opt, const void *data, size_t size,
const char *color)
{
- if (opt->color && color && color[0]) {
+ if (want_color(opt->color) && color && color[0]) {
opt->output(opt, color, strlen(color));
opt->output(opt, data, size);
opt->output(opt, GIT_COLOR_RESET, strlen(GIT_COLOR_RESET));