DORMANTno replies

[PATCH] commit --interactive: properly update the index before commiting

From: Gerrit Pape <hidden>
Date: 2016-06-15 22:44:39
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 builtin-commit.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 07872c8..b294c1f 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -223,6 +223,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();
 	}
-- 
1.5.5.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help