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.2.5~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/93969438dca50c7f0039fcf35e7ab82776d4122f?hp=--cc 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 --- 93969438dca50c7f0039fcf35e7ab82776d4122f diff --git a/builtin-apply.c b/builtin-apply.c index 490e23ef40..9ee9393662 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); }