From: Linus Torvalds Date: Sun, 5 Aug 2007 04:48:08 +0000 (-0700) Subject: apply: remove directory that becomes empty by renaming the last file away X-Git-Tag: v1.5.3-rc5~65^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=93969438dca50c7f0039fcf35e7ab82776d4122f;p=git.git apply: remove directory that becomes empty by renaming the last file away We attempt to remove directory that becomes empty after removal of a file. We should do the same when we rename an existing file away. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- diff --git a/builtin-apply.c b/builtin-apply.c index 490e23ef4..9ee939366 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2489,7 +2489,7 @@ static void write_out_one_result(struct patch *patch, int phase) * thing: remove the old, write the new */ if (phase == 0) - remove_file(patch, 0); + remove_file(patch, patch->is_rename); if (phase == 1) create_file(patch); }