X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=builtin-apply.c;h=f312798af38553e0badeda9732736a62460eae05;hb=1d035f85649cbb0a4fcc3e341f7e854acf9cf3c1;hp=b415daf07edacacd8bda0527bb5ed229be91c861;hpb=297f6a535cb46d246d47a9ff2473cef4ee1ada27;p=~andy%2Fgit diff --git a/builtin-apply.c b/builtin-apply.c index b415daf07..f312798af 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2441,7 +2441,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s 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) @@ -2453,7 +2453,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s 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;