Skip to content

Commit

Permalink
commit: abort commit if interactive add failed
Browse files Browse the repository at this point in the history
Previously we ignored the result of calling add_interactive,
which meant that if an error occurred we simply committed
whatever happened to be in the index.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 5, 2009
1 parent e1dc49b commit 4f6a32f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
const char **pathspec = NULL;

if (interactive) {
interactive_add(argc, argv, prefix);
if (interactive_add(argc, argv, prefix) != 0)
die("interactive add failed");
if (read_cache() < 0)
die("index file corrupt");
commit_style = COMMIT_AS_IS;
Expand Down

0 comments on commit 4f6a32f

Please sign in to comment.