summaryrefslogtreecommitdiff
path: root/git/objects
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-06-13 16:13:35 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-13 16:13:35 +0200
commit9b6f38d02c8ed1fb07eb6782b918f31efc4c42f3 (patch)
tree66154f23e92f221c4c34d455d92938278ebab08d /git/objects
parent59587d81412ca9da1fd06427efd864174d76c1c5 (diff)
downloadgitpython-9b6f38d02c8ed1fb07eb6782b918f31efc4c42f3.tar.gz
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')
-rw-r--r--git/objects/submodule/base.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index 2160299b..45b24a0d 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -13,7 +13,8 @@ from git.util import (
Iterable,
join_path_native,
to_native_path_linux,
- RemoteProgress
+ RemoteProgress,
+ rmtree
)
from git.config import SectionConstraint
@@ -29,8 +30,6 @@ import os
import sys
import time
-import shutil
-
__all__ = ["Submodule", "UpdateProgress"]
@@ -622,7 +621,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
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
@@ -671,7 +670,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
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