dvcignore: ignore empty (None) patterns (#4066)

This commit is contained in:
Peter Rowlands (변기호)
2020-06-18 14:31:30 +09:00
committed by GitHub
parent 51a8c782ae
commit 3a469f2e93
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -39,6 +39,7 @@ class DvcIgnorePatterns(DvcIgnore):
for ignore, group in groupby(
regex_pattern_list, lambda x: x[1]
)
if ignore is not None
]
def __call__(self, root, dirs, files):
+7
View File
@@ -166,3 +166,10 @@ def test_ignore_subrepo(tmp_dir, scm, dvc):
for _ in subrepo.brancher(all_commits=True):
assert subrepo.tree.exists(subrepo_dir / "foo")
def test_ignore_blank_line(tmp_dir, dvc):
tmp_dir.gen({"dir": {"ignored": "text", "other": "text2"}})
tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, "foo\n\ndir/ignored")
assert _files_set("dir", dvc.tree) == {"dir/other"}