local-related methods should verify that WorkingTree is in use

This commit is contained in:
pawel
2020-01-03 09:46:04 +01:00
parent 705fbd24c4
commit eb53c030c6
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -429,7 +429,9 @@ class RemoteLOCAL(RemoteBASE):
os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE)
def _unprotect_dir(self, path):
assert isinstance(self.repo.tree, CleanTree)
assert isinstance(self.repo.tree, CleanTree) and isinstance(
self.repo.tree.tree, WorkingTree
)
for fname in self.repo.tree.walk_files(path):
RemoteLOCAL._unprotect_file(fname)
+2 -1
View File
@@ -33,8 +33,9 @@ def get_inode(path):
def get_mtime_and_size(path, tree):
from dvc.ignore import CleanTree
from dvc.scm.tree import WorkingTree
assert isinstance(tree, CleanTree)
assert isinstance(tree, CleanTree) and isinstance(tree.tree, WorkingTree)
if os.path.isdir(fspath_py35(path)):
size = 0