Skip to content

Commit

Permalink
git-apply: do not barf when updating an originally empty file.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Mar 22, 2006
1 parent 8c9e794 commit 3103cf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3103cf9

Please sign in to comment.