mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-17 23:10:10 +01:00
local-related methods should verify that WorkingTree is in use
This commit is contained in:
+3
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user