summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-25 18:47:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-25 18:47:49 (GMT)
commit75b1b04c63e3dfa02fd71caa95c17ed2c3b43050 (patch)
tree75b33ebe54fbe3ce500a8eaaa1c87eec193010d2 /builtin/grep.c
parent94c734a60726c78048e0a7b136df88f1c9dc1d60 (diff)
parentf7febbea07cf6d65f85b0cdb6684d2e3666c557e (diff)
downloadgit-75b1b04c63e3dfa02fd71caa95c17ed2c3b43050.zip
git-75b1b04c63e3dfa02fd71caa95c17ed2c3b43050.tar.gz
git-75b1b04c63e3dfa02fd71caa95c17ed2c3b43050.tar.bz2
Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i' into maint
"git grep -O" to show the lines that hit in the pager did not work well with case insensitive search. We now spawn "less" with its "-I" option when it is used as the pager (which is the default). * sk/spawn-less-case-insensitively-from-grep-O-i: git grep -O -i: if the pager is 'less', pass the '-I' option
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 69ac2d8..b8d440d 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -874,6 +874,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",