From 12c7013062c89a4f9f75d7459a7ed654f3ac174f Mon Sep 17 00:00:00 2001 From: karajan1001 Date: Tue, 11 Aug 2020 15:53:49 +0800 Subject: [PATCH] Remove dvcignore reset in `repo._reset` (#4371) * Remove dvcignore reset in `repo._reset` Repo `add`,`checkout`,etc will not change `.dvcignore`, and can remove dvcignore reset after these operations. * Reset dvcignore manually after a subrepo created. 1. subrepo created during session open time. --- dvc/repo/__init__.py | 1 - tests/func/test_tree.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py index 6d98682727..329dafa034 100644 --- a/dvc/repo/__init__.py +++ b/dvc/repo/__init__.py @@ -615,4 +615,3 @@ def _reset(self): self.__dict__.pop("graph", None) self.__dict__.pop("stages", None) self.__dict__.pop("pipelines", None) - self.tree.__dict__.pop("dvcignore", None) diff --git a/tests/func/test_tree.py b/tests/func/test_tree.py index ad09e5312f..a53a515a2e 100644 --- a/tests/func/test_tree.py +++ b/tests/func/test_tree.py @@ -258,6 +258,7 @@ def test_walk_dont_ignore_subrepos(tmp_dir, scm, dvc): scm.commit("Add subrepo") dvc_tree = dvc.tree + dvc_tree.__dict__.pop("dvcignore") scm_tree = scm.get_tree("HEAD", use_dvcignore=True) path = os.fspath(tmp_dir) get_dirs = itemgetter(1)