builtin-apply: Show a more descriptive error on failure when opening a patch
[gitweb.git] / builtin-apply.c
index 03f2e950ba55bce81a846514926512af6746f41b..65388353a75814d940171aa259e4058683f355a2 100644 (file)
@@ -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);