提交 4f6a32f8 编写于 作者: J Jeff King 提交者: Junio C Hamano

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: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 e1dc49bc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册