author | Linus Torvalds <torvalds@osdl.org> | |
Sat, 1 Oct 2005 06:25:23 +0000 (23:25 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 1 Oct 2005 06:52:48 +0000 (23:52 -0700) | ||
commit | 1fea629f794cda57cc161979dab903ec7460cc7c | |
tree | d2ceb2e65f686561ec679891cc82272e4cccfd2c | tree | snapshot |
parent | 88cd621deedd2aab8f0a4c6ea3afed7269e66d0c | commit | diff |
[PATCH] Flag empty patches as errors
A patch that contains no actual diff, and that doesn't change any
meta-data is bad. It shouldn't be a patch at all, and git-apply shouldn't
just accept it.
This caused a corrupted patch to be silently applied as an empty change in
the kernel, because the corruption ended up making the patch look empty.
An example of such a patch is one that contains the patch header, but
where the initial fragment header (the "@@ -nr,.." line) is missing,
causing us to not parse any fragments.
The real "patch" program will also flag such patches as bad, with the
message
patch: **** Only garbage was found in the patch input.
and we should do likewise.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
A patch that contains no actual diff, and that doesn't change any
meta-data is bad. It shouldn't be a patch at all, and git-apply shouldn't
just accept it.
This caused a corrupted patch to be silently applied as an empty change in
the kernel, because the corruption ended up making the patch look empty.
An example of such a patch is one that contains the patch header, but
where the initial fragment header (the "@@ -nr,.." line) is missing,
causing us to not parse any fragments.
The real "patch" program will also flag such patches as bad, with the
message
patch: **** Only garbage was found in the patch input.
and we should do likewise.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
apply.c | diff | blob | history |