Skip to content

Commit

Permalink
commit --interactive: properly update the index before commiting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gerrit Pape authored and Junio C Hamano committed May 28, 2008
1 parent 1f684dc commit d5350fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit d5350fd

Please sign in to comment.