fetch-pack: mark die strings for translation
[gitweb.git] / builtin / grep.c
index 850bcffd9930f9341fc0e8f0f55c1e5fbad8f593..ee753a403eba0e9bc25b40a1efd200cafdf31e19 100644 (file)
@@ -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];