summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-06 11:32:49 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-06 11:32:49 -0700
commit7e03f416633b5dbd242d6552e239d50a821262c6 (patch)
tree6eb66d8ee94f6f1d52cc90b2ff1022744fd08574 /builtin/grep.c
parent7173ad76edfb016500cc7a97f35b067964085ac8 (diff)
parentf7febbea07cf6d65f85b0cdb6684d2e3666c557e (diff)
downloadgit-7e03f416633b5dbd242d6552e239d50a821262c6.tar.gz
Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i'
* 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 43af5b744f..c86a142f30 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -872,6 +872,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",