diff --git a/dvc/remote/local.py b/dvc/remote/local.py index 4a6204dcd..beb5e3a18 100644 --- a/dvc/remote/local.py +++ b/dvc/remote/local.py @@ -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) diff --git a/dvc/utils/fs.py b/dvc/utils/fs.py index 929867bb6..7cea7e314 100644 --- a/dvc/utils/fs.py +++ b/dvc/utils/fs.py @@ -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