diff --git a/builtin-commit.c b/builtin-commit.c index e3564a526a..b0fe69ecad 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -219,6 +219,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix) if (interactive) { interactive_add(argc, argv, prefix); + if (read_cache() < 0) + die("index file corrupt"); commit_style = COMMIT_AS_IS; return get_index_file(); }