From: Gerrit Pape Date: Tue, 27 May 2008 08:59:16 +0000 (+0000) Subject: commit --interactive: properly update the index before commiting X-Git-Tag: v1.5.5.3~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d5350fd2b3a4721885bf1b3353478970caef268c;p=git.git commit --interactive: properly update the index before commiting When adding files through git commit --interactive, and 'quit' afterwards, the message in the editor of the commit message indicates that many (maybe all) files are deleted from the tree. Dismissing that and running git commit afterwards does the right thing. This commit fixes git commit --interactive to properly update the index before commiting. Reported by Jiří Paleček through http://bugs.debian.org/480429 Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano --- diff --git a/builtin-commit.c b/builtin-commit.c index e3564a526..b0fe69eca 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(); }