diff --git a/dvc/repo/scm_context.py b/dvc/repo/scm_context.py index b5985b117..6f189c597 100644 --- a/dvc/repo/scm_context.py +++ b/dvc/repo/scm_context.py @@ -2,6 +2,7 @@ def scm_context(method): def run(repo, *args, **kw): try: result = method(repo, *args, **kw) + repo.scm.reset_tracked_files() repo.scm.reset_ignores() repo.scm.remind_to_track() return result diff --git a/dvc/scm/base.py b/dvc/scm/base.py index d7f5333e3..e52fafe99 100644 --- a/dvc/scm/base.py +++ b/dvc/scm/base.py @@ -126,6 +126,11 @@ class Base(object): Method to reset in-memory ignore storing mechanism. """ + def reset_tracked_files(self): + """ + Method to reset in-memory tracked files storing mechanism. + """ + def remind_to_track(self): """ Method to remind user to track newly created files handled by scm diff --git a/dvc/scm/git/__init__.py b/dvc/scm/git/__init__.py index 339e64339..04b42747d 100644 --- a/dvc/scm/git/__init__.py +++ b/dvc/scm/git/__init__.py @@ -245,6 +245,9 @@ class Git(Base): def reset_ignores(self): self.ignored_paths = [] + def reset_tracked_files(self): + self.files_to_track = [] + def remind_to_track(self): if not self.files_to_track: return