diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-08 08:11:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-08 08:11:47 -0700 |
commit | af3f929f9546268ede788b4217ff0b6a655ab62a (patch) | |
tree | 40db5eeb058ce126f5ae6ee6f0d9e0898abd9109 | |
parent | fcbfd5a6b2c87dc5ecd1d6c4e94c56eebf44c8ac (diff) | |
download | git-af3f929f9546268ede788b4217ff0b6a655ab62a.tar.gz |
git-apply: creatign empty files is nonfatal
(but it will result in a warning)
-rw-r--r-- | apply.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -630,8 +630,11 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s if (patch->is_new != !oldlines) return error("new file depends on old contents"); - if (patch->is_delete != !newlines) - return error("deleted file still has contents"); + if (patch->is_delete != !newlines) { + if (newlines) + return error("deleted file still has contents"); + fprintf(stderr, "** warning: file %s becomes empty but is not deleted\n", patch->new_name); + } /* Parse the thing.. */ line += len; |