Skip to content

Commit

Permalink
git-apply: use default name for mode change patches
Browse files Browse the repository at this point in the history
Pure mode changes won't have the file-name in the extended header lines,
so make sure we pick it up from the default name from the "diff --git"
line.
  • Loading branch information
Linus Torvalds committed Jun 17, 2005
1 parent aeac668 commit b7e8039
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apply.c
Expand Up @@ -570,8 +570,11 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc
int git_hdr_len = parse_git_header(line, len, size, patch);
if (git_hdr_len <= len)
continue;
if (!patch->old_name && !patch->new_name)
die("git diff header lacks filename information (line %d)", linenr);
if (!patch->old_name && !patch->new_name) {
if (!patch->def_name)
die("git diff header lacks filename information (line %d)", linenr);
patch->old_name = patch->new_name = patch->def_name;
}
*hdrsize = git_hdr_len;
return offset;
}
Expand Down

0 comments on commit b7e8039

Please sign in to comment.