From: Derrick Stolee via GitGitGadget Date: Tue, 16 Mar 2021 21:16:59 GMT Subject: [PATCH 11/27] grep: ensure full index Message-ID: In-Reply-To: From: Derrick Stolee Before iterating over all cache entries, ensure that a sparse index is expanded to a full one so we do not miss blobs to scan. Later, this can integrate more carefully with sparse indexes with proper testing. Signed-off-by: Derrick Stolee --- builtin/grep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/grep.c b/builtin/grep.c index 4e91a253ac3b..652d6d60f644 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -504,6 +504,7 @@ static int grep_cache(struct grep_opt *opt, if (repo_read_index(repo) < 0) die(_("index file corrupt")); + ensure_full_index(repo->index); for (nr = 0; nr < repo->index->cache_nr; nr++) { const struct cache_entry *ce = repo->index->cache[nr]; -- gitgitgadget