From d67a36bd08a542b2dc86b357d600014b20a7bb30 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 8 Feb 2011 00:17:24 -0600 Subject: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option Signed-off-by: Johannes Schindelin --- builtin/grep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/grep.c b/builtin/grep.c index 82530a61b4..a132e8909e 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -982,6 +982,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (len > 4 && is_dir_sep(pager[len - 5])) pager += len - 4; + if (opt.ignore_case && !strcmp("less", pager)) + string_list_append(&path_list, "-i"); + if (!strcmp("less", pager) || !strcmp("vi", pager)) { struct strbuf buf = STRBUF_INIT; strbuf_addf(&buf, "+/%s%s", -- 2.11.4.GIT