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 <junkio@cox.net>
Junio C Hamano committed
Nov 19, 2005 at 19:50 UTC
80e21a9ed809d98788ff6fb705d911bee37d460b
1 file changed
+4
git-merge-recursive.py
+4
@@ -293,6 +293,10 @@ def removeFile(clean, path):
293
except OSError, e:
294
if e.errno != errno.ENOENT and e.errno != errno.EISDIR:
295
raise
296
+ try:
297
+ os.removedirs(os.path.dirname(path))
298
+ except:
299
+ pass
300
301
def uniquePath(path, branch):
302
def fileExists(path):