Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
grep: use the right index instead of the_index
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Mon, 13 Aug 2018 16:14:34 +0000
(18:14 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 13 Aug 2018 21:14:43 +0000
(14:14 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c4500e2
)
diff --git
a/builtin/grep.c
b/builtin/grep.c
index 9d7ba87f9b6ec075898ca01ec93e42b663de8eba..b7033954ace2c1cf96190ce289ed49e67d39611e 100644
(file)
--- 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) &&
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))) {
/*
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) &&
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;
hit |= grep_submodule(opt, repo, pathspec, NULL, ce->name, ce->name);
} else {
continue;