{"thread":{"id":"13685","subject":"[PATCH] commit --interactive: properly update the index before commiting","startedAt":"2008-05-27T08:59:16Z","lastAt":"2008-05-27T08:59:16Z","messageCount":1,"participants":["Gerrit Pape"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77838","messageId":"20080527085916.23645.qmail@8ea7804c723d58.315fe32.mid.smarden.org","threadId":"13685","inReplyTo":null,"subject":"[PATCH] commit --interactive: properly update the index before commiting","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-05-27T08:59:16Z","receivedAt":"2008-05-27T08:59:16Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"When adding files through git commit --interactive, and 'quit'\nafterwards, the message in the editor of the commit message indicates\nthat many (maybe all) files are deleted from the tree.  Dismissing that\nand running git commit afterwards does the right thing.  This commit\nfixes git commit --interactive to properly update the index before\ncommiting.\n\nReported by Jiří Paleček through\n http://bugs.debian.org/480429\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n builtin-commit.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 07872c8..b294c1f 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -223,6 +223,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)\n \n \tif (interactive) {\n \t\tinteractive_add(argc, argv, prefix);\n+\t\tif (read_cache() < 0)\n+\t\t\tdie(\"index file corrupt\");\n \t\tcommit_style = COMMIT_AS_IS;\n \t\treturn get_index_file();\n \t}\n-- \n1.5.5.1\n"}]}