summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2008-05-27 08:59:16 +0000
committerJunio C Hamano <gitster@pobox.com>2008-05-27 22:32:47 -0700
commitd5350fd2b3a4721885bf1b3353478970caef268c (patch)
tree5f81b0fb9baebbe54d86f301fab3cd61ce6a3e6c /builtin-commit.c
parent1f684dc01c6a45341e8e47d8393f0ef66fdfc398 (diff)
downloadgit-d5350fd2b3a4721885bf1b3353478970caef268c.tar.gz
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>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c2
1 files changed, 2 insertions, 0 deletions
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();
}