grep is a porcelain command, so translating its error message is a good idea. Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx> --- builtin/grep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 69f0743619f..2c2d6cc6bca 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -488,8 +488,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo, strbuf_addstr(&name, repo->submodule_prefix); } - if (repo_read_index(repo) < 0) - die("index file corrupt"); + repo_read_index_or_die(repo); for (nr = 0; nr < repo->index->cache_nr; nr++) { const struct cache_entry *ce = repo->index->cache[nr]; -- 2.17.0.582.gccdcbd54c44.dirty