Skip to content

Commit 3103cf9

Browse files
author
Junio C Hamano
committed
git-apply: do not barf when updating an originally empty file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 8c9e794 commit 3103cf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
834834
patch->new_name = NULL;
835835
}
836836

837-
if (patch->is_new != !oldlines)
837+
if (patch->is_new && oldlines)
838838
return error("new file depends on old contents");
839839
if (patch->is_delete != !newlines) {
840840
if (newlines)

0 commit comments

Comments
 (0)