summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 025a070)
raw | patch | inline | side by side (parent: 025a070)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 12 Jun 2005 16:37:49 +0000 (09:37 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sun, 12 Jun 2005 16:37:49 +0000 (09:37 -0700) |
A meaningful (ie non-empty) git patch always has more information in the
header than just the "diff --git" line itself: it needs to have either a
patch associated with it (which implies "---" and "+++" lines in the
header) or it needs to have rename/copy/delete/create information in it.
Just ignore git patches which have no change information. Otherwise we'll
end up with a patch that doesn't have filenames etc filled in, and we'll
be unhappy.
header than just the "diff --git" line itself: it needs to have either a
patch associated with it (which implies "---" and "+++" lines in the
header) or it needs to have rename/copy/delete/create information in it.
Just ignore git patches which have no change information. Otherwise we'll
end up with a patch that doesn't have filenames etc filled in, and we'll
be unhappy.
apply.c | patch | blob | history |
index 20c41c51433d18b21b914f0e700501c5244de6e0..01bcb947ed399a943b61336f9008d38d2cf514f5 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -568,7 +568,7 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc
*/
if (!memcmp("diff --git ", line, 11)) {
int git_hdr_len = parse_git_header(line, len, size, patch);
- if (git_hdr_len < 0)
+ if (git_hdr_len <= len)
continue;
if (!patch->old_name && !patch->new_name)
die("git diff header lacks filename information (line %d)", linenr);