]> git.ipfire.org Git - thirdparty/git.git/commitdiff
am: don't die in read_author_script()
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 31 Oct 2018 10:15:52 +0000 (10:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Nov 2018 03:08:06 +0000 (12:08 +0900)
The caller is already prepared to handle errors returned from this
function so there is no need for it to die if it cannot read the file.

Suggested-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c

index 5e643e2a3e3d70d9c674d3edab2eb1f2f08f3392..4f7f28a9dcd7752364bdcbc3aa1027bf5891b371 100644 (file)
@@ -318,7 +318,8 @@ static int read_author_script(struct am_state *state)
        if (fd < 0) {
                if (errno == ENOENT)
                        return 0;
-               die_errno(_("could not open '%s' for reading"), filename);
+               return error_errno(_("could not open '%s' for reading"),
+                                  filename);
        }
        strbuf_read(&buf, fd, 0);
        close(fd);