From 80e21a9ed809d98788ff6fb705d911bee37d460b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 19 Nov 2005 19:50:44 -0800 Subject: [PATCH] merge-recursive::removeFile: remove empty directories When the last file in a directory is removed as the result of a merge, try to rmdir the now-empty directory. Signed-off-by: Junio C Hamano --- git-merge-recursive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-merge-recursive.py b/git-merge-recursive.py index d7d36aa7..37258ad7 100755 --- a/git-merge-recursive.py +++ b/git-merge-recursive.py @@ -293,6 +293,10 @@ def removeFile(clean, path): except OSError, e: if e.errno != errno.ENOENT and e.errno != errno.EISDIR: raise + try: + os.removedirs(os.path.dirname(path)) + except: + pass def uniquePath(path, branch): def fileExists(path): -- 2.11.0