aboutsummaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@gmail.com>2008-04-14 12:30:27 -0300
committerJunio C Hamano <gitster@pobox.com>2008-04-15 22:42:08 -0700
commit1da16439bece6b90e1ce033bc50c5316f2c5dac2 (patch)
treee0723c9ebcc467c07219a7ae92db6e5132357128 /builtin-apply.c
parent2c2d02a6a72ce690df9dafea5e76bd4395d16927 (diff)
downloadgit-1da16439bece6b90e1ce033bc50c5316f2c5dac2.tar.gz
git-1da16439bece6b90e1ce033bc50c5316f2c5dac2.tar.xz
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 <albertito@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 03f2e950b..65388353a 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -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);