From: Junio C Hamano Date: Fri, 6 Feb 2009 02:06:11 +0000 (-0800) Subject: Merge branch 'jc/maint-apply-fix' into maint X-Git-Tag: v1.6.1.3~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c7893501e879ebb541a55e5633f7e0f1729407cb?ds=inline;hp=-c Merge branch 'jc/maint-apply-fix' into maint * jc/maint-apply-fix: builtin-apply.c: do not set bogus mode in check_preimage() for deleted path --- c7893501e879ebb541a55e5633f7e0f1729407cb diff --combined builtin-apply.c index b31007ba99,8248e09476..58d998577e --- a/builtin-apply.c +++ b/builtin-apply.c @@@ -1253,9 -1253,8 +1253,9 @@@ static char *inflate_it(const void *dat stream.avail_in = size; stream.next_out = out = xmalloc(inflated_size); stream.avail_out = inflated_size; - inflateInit(&stream); - st = inflate(&stream, Z_FINISH); + git_inflate_init(&stream); + st = git_inflate(&stream, Z_FINISH); + git_inflate_end(&stream); if ((st != Z_STREAM_END) || stream.total_out != inflated_size) { free(out); return NULL; @@@ -2436,7 -2435,7 +2436,7 @@@ static int check_preimage(struct patch return error("%s: %s", old_name, strerror(errno)); } - if (!cached) + if (!cached && !tpatch) st_mode = ce_mode_from_stat(*ce, st->st_mode); if (patch->is_new < 0) @@@ -2448,7 -2447,7 +2448,7 @@@ if (st_mode != patch->old_mode) fprintf(stderr, "warning: %s has type %o, expected %o\n", old_name, st_mode, patch->old_mode); - if (!patch->new_mode) + if (!patch->new_mode && !patch->is_delete) patch->new_mode = st_mode; return 0;