@matheusbsbs / matheus-bagliano / commits / 4f6a32f8af
Fork 0

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>

Jeff King committed Apr 3, 2009 at 15:28 UTC 4f6a32f8af9cceaf0c8ccf6d00d2f100dab5a6db
1 file changed +2 -1
builtin-commit.c
+2 -1
@@ -224,7 +224,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
224 const char **pathspec = NULL;
225
226 if (interactive) {
227 - interactive_add(argc, argv, prefix);
227 + if (interactive_add(argc, argv, prefix) != 0)
228 + die("interactive add failed");
229 if (read_cache() < 0)
230 die("index file corrupt");
231 commit_style = COMMIT_AS_IS;