summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:43 (GMT)
commita4009b0b452550036a5e3dd4712797d14a3284a0 (patch)
tree5481deaa95a8e8d5269277b352b81f8f45fd80d5 /builtin/grep.c
parentc4500e251f89cbbc49fe90b832348ea9d4899946 (diff)
downloadgit-a4009b0b452550036a5e3dd4712797d14a3284a0.zip
git-a4009b0b452550036a5e3dd4712797d14a3284a0.tar.gz
git-a4009b0b452550036a5e3dd4712797d14a3284a0.tar.bz2
grep: use the right index instead of the_index
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 9d7ba87..b703395 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -497,7 +497,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,
strbuf_addstr(&name, ce->name);
if (S_ISREG(ce->ce_mode) &&
- match_pathspec(&the_index, pathspec, name.buf, name.len, 0, NULL,
+ match_pathspec(repo->index, pathspec, name.buf, name.len, 0, NULL,
S_ISDIR(ce->ce_mode) ||
S_ISGITLINK(ce->ce_mode))) {
/*
@@ -515,7 +515,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,
hit |= grep_file(opt, name.buf);
}
} else if (recurse_submodules && S_ISGITLINK(ce->ce_mode) &&
- submodule_path_match(&the_index, pathspec, name.buf, NULL)) {
+ submodule_path_match(repo->index, pathspec, name.buf, NULL)) {
hit |= grep_submodule(opt, repo, pathspec, NULL, ce->name, ce->name);
} else {
continue;