mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
dvcignore: ignore file '.git' by default (#5745)
* dvcignore: ignore file '.git' by default * update tests
This commit is contained in:
+6
-1
@@ -183,7 +183,12 @@ class DvcIgnoreFilter:
|
||||
def __init__(self, fs, root_dir):
|
||||
from dvc.repo import Repo
|
||||
|
||||
default_ignore_patterns = [".hg/", ".git/", "{}/".format(Repo.DVC_DIR)]
|
||||
default_ignore_patterns = [
|
||||
".hg/",
|
||||
".git/",
|
||||
".git",
|
||||
"{}/".format(Repo.DVC_DIR),
|
||||
]
|
||||
|
||||
self.fs = fs
|
||||
self.root_dir = root_dir
|
||||
|
||||
@@ -112,7 +112,7 @@ def test_ignore_collecting_dvcignores(tmp_dir, dvc, dname):
|
||||
assert (
|
||||
DvcIgnorePatterns(
|
||||
*merge_patterns(
|
||||
_to_pattern_info_list([".hg/", ".git/", ".dvc/"]),
|
||||
_to_pattern_info_list([".hg/", ".git/", ".git", ".dvc/"]),
|
||||
os.fspath(tmp_dir),
|
||||
_to_pattern_info_list([os.path.basename(dname)]),
|
||||
top_ignore_path,
|
||||
@@ -344,7 +344,7 @@ def test_pattern_trie_fs(tmp_dir, dvc):
|
||||
)
|
||||
|
||||
base_pattern = (
|
||||
_to_pattern_info_list([".hg/", ".git/", ".dvc/"]),
|
||||
_to_pattern_info_list([".hg/", ".git/", ".git", ".dvc/"]),
|
||||
os.fspath(tmp_dir),
|
||||
)
|
||||
first_pattern = merge_patterns(
|
||||
|
||||
Reference in New Issue
Block a user