Browse Source

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>
maint
Junio C Hamano 19 years ago
parent
commit
80e21a9ed8
  1. 4
      git-merge-recursive.py

4
git-merge-recursive.py

@ -293,6 +293,10 @@ def removeFile(clean, path):
except OSError, e: except OSError, e:
if e.errno != errno.ENOENT and e.errno != errno.EISDIR: if e.errno != errno.ENOENT and e.errno != errno.EISDIR:
raise raise
try:
os.removedirs(os.path.dirname(path))
except:
pass


def uniquePath(path, branch): def uniquePath(path, branch):
def fileExists(path): def fileExists(path):

Loading…
Cancel
Save