am: don't die in read_author_script()
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>
Phillip Wood committed
Oct 31, 2018 at 10:15 UTC
28224c23597e5d4b405b87e4e3dc321fd2d2c4f6
1 file changed
+2
-1
builtin/am.c
+2
-1
@@ -318,7 +318,8 @@ static int read_author_script(struct am_state *state)
318
if (fd < 0) {
319
if (errno == ENOENT)
320
return 0;
321
- die_errno(_("could not open '%s' for reading"), filename);
321
+ return error_errno(_("could not open '%s' for reading"),
322
+ filename);
323
}
324
strbuf_read(&buf, fd, 0);
325
close(fd);