From: Junio C Hamano Date: Wed, 22 Mar 2006 08:21:07 +0000 (-0800) Subject: git-apply: do not barf when updating an originally empty file. X-Git-Tag: v1.3.0-rc1~11^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3103cf9e1e09b0045a60542f24a2a1e4ed7b1237;p=git.git git-apply: do not barf when updating an originally empty file. Signed-off-by: Junio C Hamano --- diff --git a/apply.c b/apply.c index 179b3bbd..2da225a8 100644 --- a/apply.c +++ b/apply.c @@ -834,7 +834,7 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s patch->new_name = NULL; } - if (patch->is_new != !oldlines) + if (patch->is_new && oldlines) return error("new file depends on old contents"); if (patch->is_delete != !newlines) { if (newlines)