Skip to content

Commit

Permalink
builtin-apply: Show a more descriptive error on failure when opening …
Browse files Browse the repository at this point in the history
…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 <albertito@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alberto Bertogli authored and Junio C Hamano committed Apr 16, 2008
1 parent 2c2d02a commit 1da1643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)

fd = open(arg, O_RDONLY);
if (fd < 0)
usage(apply_usage);
die("can't open patch '%s': %s", arg, strerror(errno));
read_stdin = 0;
set_default_whitespace_mode(whitespace_option);
errs |= apply_patch(fd, arg, inaccurate_eof);
Expand Down

0 comments on commit 1da1643

Please sign in to comment.