From 4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 3 Apr 2009 15:28:56 -0400 Subject: [PATCH] commit: abort commit if interactive add failed 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 Signed-off-by: Junio C Hamano --- builtin-commit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-commit.c b/builtin-commit.c index 6cbdd55f16..fde7b891d9 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -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; -- 2.11.4.GIT