1. Stefan Saasen
  2. git


Gerrit Pape  committed d5350fd

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

Reported by Jiří Paleček through

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

  • Participants
  • Parent commits 1f684dc
  • Branches master

Comments (0)

Files changed (1)

File builtin-commit.c

View file
  • Ignore whitespace
 	if (interactive) {
 		interactive_add(argc, argv, prefix);
+		if (read_cache() < 0)
+			die("index file corrupt");
 		commit_style = COMMIT_AS_IS;
 		return get_index_file();