mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00:00
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>
This commit is contained in:
parent
e1dc49bcde
commit
4f6a32f8af
1 changed files with 2 additions and 1 deletions
|
@ -224,7 +224,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
|
||||||
const char **pathspec = NULL;
|
const char **pathspec = NULL;
|
||||||
|
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
interactive_add(argc, argv, prefix);
|
if (interactive_add(argc, argv, prefix) != 0)
|
||||||
|
die("interactive add failed");
|
||||||
if (read_cache() < 0)
|
if (read_cache() < 0)
|
||||||
die("index file corrupt");
|
die("index file corrupt");
|
||||||
commit_style = COMMIT_AS_IS;
|
commit_style = COMMIT_AS_IS;
|
||||||
|
|
Loading…
Reference in a new issue