Skip to content

Commit

Permalink
merge-recursive::removeFile: remove empty directories
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 20, 2005
1 parent 397c766 commit 80e21a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-merge-recursive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 80e21a9

Please sign in to comment.