summaryrefslogtreecommitdiff
path: root/builtin/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-21 19:42:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-21 19:42:45 (GMT)
commit406cc9b822b44a1d53c1a45536460992529aec88 (patch)
tree123a7975e84cd1d8fff6feaf2fd92355a4e23fb8 /builtin/apply.c
parent3bb8d69cddbcad4bd4ae3d1281c42c1aeb297355 (diff)
parentcc64b318f26c9e176c4f07b1a459a86e7a04c4eb (diff)
downloadgit-406cc9b822b44a1d53c1a45536460992529aec88.zip
git-406cc9b822b44a1d53c1a45536460992529aec88.tar.gz
git-406cc9b822b44a1d53c1a45536460992529aec88.tar.bz2
Merge branch 'bc/maint-apply-check-no-patch' into maint
* bc/maint-apply-check-no-patch: builtin/apply.c: report error on failure to recognize input t/t4131-apply-fake-ancestor.sh: fix broken test
Diffstat (limited to 'builtin/apply.c')
-rw-r--r--builtin/apply.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index b3b59db..c24dc54 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -3587,15 +3587,12 @@ static int write_out_one_reject(struct patch *patch)
return -1;
}
-static int write_out_results(struct patch *list, int skipped_patch)
+static int write_out_results(struct patch *list)
{
int phase;
int errs = 0;
struct patch *l;
- if (!list && !skipped_patch)
- return error("No changes");
-
for (phase = 0; phase < 2; phase++) {
l = list;
while (l) {
@@ -3721,6 +3718,9 @@ static int apply_patch(int fd, const char *filename, int options)
offset += nr;
}
+ if (!list && !skipped_patch)
+ die("unrecognized input");
+
if (whitespace_error && (ws_error_action == die_on_ws_error))
apply = 0;
@@ -3738,7 +3738,7 @@ static int apply_patch(int fd, const char *filename, int options)
!apply_with_reject)
exit(1);
- if (apply && write_out_results(list, skipped_patch))
+ if (apply && write_out_results(list))
exit(1);
if (fake_ancestor)