зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
c4500e251f
Коммит
a4009b0b45
|
@ -497,7 +497,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,
|
||||||
strbuf_addstr(&name, ce->name);
|
strbuf_addstr(&name, ce->name);
|
||||||
|
|
||||||
if (S_ISREG(ce->ce_mode) &&
|
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_ISDIR(ce->ce_mode) ||
|
||||||
S_ISGITLINK(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);
|
hit |= grep_file(opt, name.buf);
|
||||||
}
|
}
|
||||||
} else if (recurse_submodules && S_ISGITLINK(ce->ce_mode) &&
|
} 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);
|
hit |= grep_submodule(opt, repo, pathspec, NULL, ce->name, ce->name);
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче