ls-tree: major rewrite to do pathspec
[gitweb.git] / git-merge-recursive.py
index d7d36aa7d11299d3a1e91dce1bc9572ac56a7c08..01292335509bfd1460e12e0e1d86c4fcd1f265a4 100755 (executable)
@@ -245,7 +245,7 @@ def updateFileExt(sha, mode, path, updateCache, updateWd):
 
             try:
                 createDir = not stat.S_ISDIR(os.lstat(p).st_mode)
-            except
+            except OSError:
                 createDir = True
             
             if createDir:
@@ -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 OSError:
+            pass
 
 def uniquePath(path, branch):
     def fileExists(path):