Skip to content

Commit 1da1643

Browse files
albertitogitster
authored andcommitted
builtin-apply: Show a more descriptive error on failure when opening a patch
When a patch can't be opened (it doesn't exist, there are permission problems, etc.) we get the usage text, which is not a proper indication of failure. Signed-off-by: Alberto Bertogli <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c2d02a commit 1da1643

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
28882888

28892889
fd = open(arg, O_RDONLY);
28902890
if (fd < 0)
2891-
usage(apply_usage);
2891+
die("can't open patch '%s': %s", arg, strerror(errno));
28922892
read_stdin = 0;
28932893
set_default_whitespace_mode(whitespace_option);
28942894
errs |= apply_patch(fd, arg, inaccurate_eof);

0 commit comments

Comments
 (0)