summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-04-03 19:28:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-05 07:37:32 (GMT)
commit4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db (patch)
tree5becc1ddbe0aa3b92630cc2a26cf043173db46b9
parente1dc49bcdefd362e129c9ee3a85527b518f9b49d (diff)
downloadgit-4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db.zip
git-4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db.tar.gz
git-4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db.tar.bz2
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 6cbdd55..fde7b89 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;