diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2011-06-13 16:13:35 +0200 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-13 17:18:23 +0200 |
| commit | 5a3b7310373351995c6f14d332773646be319a1f (patch) | |
| tree | af0f2cffa26f4f291d04619600e1b8a828ae33a1 /git/objects/submodule/base.py | |
| parent | 963bbd722aebc622f7a36945a46f324855c3e1d2 (diff) | |
| download | GitPython-5a3b7310373351995c6f14d332773646be319a1f.tar.gz GitPython-5a3b7310373351995c6f14d332773646be319a1f.zip | |
Submodule now uses a specialized method to remove its trees to allow read-only files to be removed on windows as well
Diffstat (limited to 'git/objects/submodule/base.py')
| -rw-r--r-- | git/objects/submodule/base.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index a33dd8ad..1b94f522 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -18,6 +18,7 @@ from git.util import ( Iterable, join_path_native, to_native_path_linux, + rmtree ) from git.db.interface import RemoteProgress @@ -35,8 +36,6 @@ import os import sys import time -import shutil - __all__ = ["Submodule", "UpdateProgress"] @@ -634,7 +633,7 @@ class Submodule(util.IndexObject, Iterable, Traversable, RepoAliasMixin): if os.path.islink(mp): method = os.remove elif os.path.isdir(mp): - method = shutil.rmtree + method = rmtree elif os.path.exists(mp): raise AssertionError("Cannot forcibly delete repository as it was neither a link, nor a directory") #END handle brutal deletion @@ -683,7 +682,7 @@ class Submodule(util.IndexObject, Iterable, Traversable, RepoAliasMixin): if not dry_run: wtd = mod.working_tree_dir del(mod) # release file-handles (windows) - shutil.rmtree(wtd) + rmtree(wtd) # END delete tree if possible # END handle force # END handle module deletion |
