diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-17 15:23:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-17 15:23:40 -0700 |
commit | b7e8039a6f4a250bc0b9c9ca2d75b60368058413 (patch) | |
tree | f8fb91999d2456065b4a4412d89b8b1893be3bee /apply.c | |
parent | aeac6681250440bc9801d6d6cc293cc708895b46 (diff) | |
download | git-b7e8039a6f4a250bc0b9c9ca2d75b60368058413.tar.gz git-b7e8039a6f4a250bc0b9c9ca2d75b60368058413.tar.xz |
git-apply: use default name for mode change patches
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.
Diffstat (limited to 'apply.c')
-rw-r--r-- | apply.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |