Don't rmdir directories that git rm has already taken care of

This commit is contained in:
Alexander van Gessel 2012-09-14 18:24:49 +01:00
parent 735390e070
commit 599082cd5a

View file

@ -227,7 +227,9 @@ class Addon(object):
if os.path.isdir(relpath):
self._rmtree(relpath, exclude)
self._execute(["rmdir", "--ignore-fail-on-non-empty", relpath])
# git rm removes directories that it empties
if os.path.exists(relpath):
self._execute(["rmdir", "--ignore-fail-on-non-empty", relpath])
else:
self._execute(["git", "rm", relpath], check_error=True)