@matheusbsbs / matheus-bagliano / commits / d5350fd2b3
Fork 0

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 <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Gerrit Pape committed May 27, 2008 at 08:59 UTC d5350fd2b3a4721885bf1b3353478970caef268c
1 file changed +2
builtin-commit.c
+2
@@ -219,6 +219,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
219
220 if (interactive) {
221 interactive_add(argc, argv, prefix);
222 + if (read_cache() < 0)
223 + die("index file corrupt");
224 commit_style = COMMIT_AS_IS;
225 return get_index_file();
226 }