Skip to content
Snippets Groups Projects
Commit 6ac5acae authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'sb/grep-die-on-unreadable-index'

Error behaviour of "git grep" when it cannot read the index was
inconsistent with other commands that uses the index, which has
been corrected to error out early.

* sb/grep-die-on-unreadable-index:
  grep: handle corrupt index files early
parents f15a486c b2aa84c7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -488,7 +488,8 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,
strbuf_addstr(&name, repo->submodule_prefix);
}
 
repo_read_index(repo);
if (repo_read_index(repo) < 0)
die("index file corrupt");
 
for (nr = 0; nr < repo->index->cache_nr; nr++) {
const struct cache_entry *ce = repo->index->cache[nr];
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment