experiments: ignore untracked files (#5029)

* git: add reset()

* experiments: exclude untracked files

* experiments: add test for untracked & staged files

* git: support checkout/reset for specific paths to HEAD state

* stage: track changed files when calling checkpoint callback

* experiments: ignore untracked files when generating exp commits

* add tests for dirty lock files

* stage: track uncached outs when generating checkpoints

* experiments: update checkpoints scm handling

* update checkpoints tests
This commit is contained in:
Peter Rowlands (변기호)
2020-12-04 17:04:45 +09:00
committed by GitHub
parent 9a9f46b2b8
commit 69eb86a06f
9 changed files with 164 additions and 87 deletions
+8
View File
@@ -394,3 +394,11 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
def diff(self, rev_a: str, rev_b: str, binary=False) -> str:
raise NotImplementedError
def reset(self, hard: bool = False, paths: Iterable[str] = None):
self.repo.head.reset(index=True, working_tree=hard, paths=paths)
def checkout_paths(self, paths: Iterable[str], force: bool = False):
"""Checkout the specified paths from HEAD index."""
if paths:
self.repo.index.checkout(paths=paths, force=force)