Skip to content

Commit

Permalink
git-apply: fix rename header parsing
Browse files Browse the repository at this point in the history
It's not "rename from" and "rename to", it's "rename old" and "rename new".

Which is illogical and doesn't match the "copy from/to" case, but that's
life. Maybe Junio will fix it up one of these days.
  • Loading branch information
Linus Torvalds committed Jun 5, 2005
1 parent a48e1d6 commit 33f4d08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ static int parse_git_header(char *line, int len, unsigned int size, struct patch
{ "new file mode ", gitdiff_newfile },
{ "copy from ", gitdiff_copysrc },
{ "copy to ", gitdiff_copydst },
{ "rename from ", gitdiff_renamesrc },
{ "rename to ", gitdiff_renamedst },
{ "rename old ", gitdiff_renamesrc },
{ "rename new ", gitdiff_renamedst },
{ "similarity index ", gitdiff_similarity },
{ "dissimilarity index ", gitdiff_dissimilarity },
{ "", gitdiff_unrecognized },
Expand Down Expand Up @@ -569,7 +569,7 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc
if (git_hdr_len < 0)
continue;
if (!patch->old_name && !patch->new_name)
die("git diff header lacks filename information");
die("git diff header lacks filename information (line %d)", linenr);
*hdrsize = git_hdr_len;
return offset;
}
Expand Down

0 comments on commit 33f4d08

Please sign in to comment.