@matheusbsbs / matheus-bagliano / commits / 3103cf9e1e
Fork 0

git-apply: do not barf when updating an originally empty file.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Mar 22, 2006 at 00:21 UTC 3103cf9e1e09b0045a60542f24a2a1e4ed7b1237
1 file changed +1 -1
apply.c
+1 -1
@@ -834,7 +834,7 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
834 patch->new_name = NULL;
835 }
836
837 - if (patch->is_new != !oldlines)
837 + if (patch->is_new && oldlines)
838 return error("new file depends on old contents");
839 if (patch->is_delete != !newlines) {
840 if (newlines)