X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=f312798af38553e0badeda9732736a62460eae05;hb=81d3fe9f4871e42ebd1af0221fa091fe5476e2f7;hp=b415daf07edacacd8bda0527bb5ed229be91c861;hpb=ddebfd1f27110bbcd0e8da0417bc425509af219a;p=git.git 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;