summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-22 08:21:07 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-22 08:21:07 (GMT)
commit3103cf9e1e09b0045a60542f24a2a1e4ed7b1237 (patch)
tree79d82d73b77441635eb328aae5e09e5345267450 /apply.c
parent8c9e7947c2a76fb21bda11816c544d50e271156d (diff)
downloadgit-3103cf9e1e09b0045a60542f24a2a1e4ed7b1237.zip
git-3103cf9e1e09b0045a60542f24a2a1e4ed7b1237.tar.gz
git-3103cf9e1e09b0045a60542f24a2a1e4ed7b1237.tar.bz2
git-apply: do not barf when updating an originally empty file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 179b3bb..2da225a 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)