reset all indecies of brancher switch

This commit is contained in:
Ivan Shcheklein
2022-12-13 23:43:23 +02:00
committed by Ruslan Kuprieiev
parent bc1b8f3494
commit e36f0e9d85
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -536,11 +536,16 @@ class Repo:
self.scm.close()
self.state.close()
def _reset_cached_indecies(self):
self.__dict__.pop("index", None)
self.__dict__.pop("dvcignore", None)
self.__dict__.pop("dvcfs", None)
self.__dict__.pop("datafs", None)
def _reset(self):
self.state.close()
self.scm._reset() # pylint: disable=protected-access
self.__dict__.pop("index", None)
self.__dict__.pop("dvcignore", None)
self._reset_cached_indecies()
def __enter__(self):
return self
+1 -1
View File
@@ -77,7 +77,7 @@ def brancher( # noqa: E302
from dvc.fs import GitFileSystem
for sha, names in found_revs.items():
self.__dict__.pop("index", None)
self._reset_cached_indecies() # pylint: disable=W0212
self.fs = GitFileSystem(scm=scm, rev=sha)
self.root_dir = self.fs.path.join("/", *repo_root_parts)