зеркало из https://github.com/microsoft/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 <junkio@cox.net>
This commit is contained in:
Родитель
397c76697f
Коммит
80e21a9ed8
|
@ -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):
|
||||||
|
|
Загрузка…
Ссылка в новой задаче