scm: implement gitignore (#5243)

* scm: implement gitignore; use `pygit2` backend

* Add is_ignored implementation on `pygit2` and `gitpython` backends.
* Also implement `._reset()` on `repo.scm` which is most of the changes.

* fix tests

* use _backend_func

* minor fixups
This commit is contained in:
Saugat Pachhai
2021-01-11 12:31:26 +02:00
committed by GitHub
parent 7fd191126e
commit a2c91d2058
8 changed files with 59 additions and 14 deletions
+2
View File
@@ -78,10 +78,12 @@ def test_ignore(tmp_dir, scm):
scm.ignore(foo)
assert (tmp_dir / ".gitignore").is_file()
scm._reset()
assert _count_gitignore_entries(target) == 1
scm.ignore(foo)
assert (tmp_dir / ".gitignore").is_file()
scm._reset()
assert _count_gitignore_entries(target) == 1
scm.ignore_remove(foo)