builtin-apply.c: do not set bogus mode in check_preimage() for deleted path
If it is deleted, it is deleted. Do not set the current mode to it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jan 25, 2009 at 23:41 UTC
a15080e5f43d840717f8e3b68410f26c8cd54db2
1 file changed
+1
-1
builtin-apply.c
+1
-1
@@ -2447,7 +2447,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s
2447
if (st_mode != patch->old_mode)
2448
fprintf(stderr, "warning: %s has type %o, expected %o\n",
2449
old_name, st_mode, patch->old_mode);
2450
- if (!patch->new_mode)
2450
+ if (!patch->new_mode && !patch->is_delete)
2451
patch->new_mode = st_mode;
2452
return 0;
2453