summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-04 11:54:20 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-04 11:54:20 (GMT)
commita622f6b35eb72b0ce738c03d6b49f760501bce78 (patch)
tree9508a491cacb3a06092b694f83e58a2c9c163287
parent6768d6b8477db41a1cfdbd1d81ac8c5131c58e1d (diff)
parent6f9f3b263b1c86889d6fae0d50c75be0f3227003 (diff)
downloadgit-a622f6b35eb72b0ce738c03d6b49f760501bce78.zip
git-a622f6b35eb72b0ce738c03d6b49f760501bce78.tar.gz
git-a622f6b35eb72b0ce738c03d6b49f760501bce78.tar.bz2
Merge branch 'maint'
* maint: apply: handle "traditional" creation/deletion diff correctly.
-rw-r--r--builtin-apply.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 11397f5..db7cdce 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1043,10 +1043,14 @@ static int parse_single_patch(char *line, unsigned long size, struct patch *patc
* then not having oldlines means the patch is creation,
* and not having newlines means the patch is deletion.
*/
- if (patch->is_new < 0 && !oldlines)
+ if (patch->is_new < 0 && !oldlines) {
patch->is_new = 1;
- if (patch->is_delete < 0 && !newlines)
+ patch->old_name = NULL;
+ }
+ if (patch->is_delete < 0 && !newlines) {
patch->is_delete = 1;
+ patch->new_name = NULL;
+ }
}
if (0 < patch->is_new && oldlines)