From: Jeff King Date: Fri, 3 Apr 2009 19:28:56 +0000 (-0400) Subject: commit: abort commit if interactive add failed X-Git-Tag: v1.6.2.3~1^2~1^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db;p=git.git 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 --- diff --git a/builtin-commit.c b/builtin-commit.c index 6cbdd55f1..fde7b891d 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;