From: Junio C Hamano Date: Sun, 20 Nov 2005 03:50:44 +0000 (-0800) Subject: merge-recursive::removeFile: remove empty directories X-Git-Tag: v0.99.9k^2~68 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=80e21a9ed809d98788ff6fb705d911bee37d460b;p=git.git 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 --- diff --git a/git-merge-recursive.py b/git-merge-recursive.py index d7d36aa7d..37258ad77 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):