Skip to content
Snippets Groups Projects
Commit 495e2cb4 authored by David Douard's avatar David Douard
Browse files

Replace usage of (deprecated) dir_filter by path_filter in Directory.from_disk()

as well as in GitCheckoutLoader.
parent 39d38c4e
No related branches found
No related tags found
1 merge request!185Replace usage of (deprecated) dir_filter by path_filter in Directory.from_disk()
Pipeline #9311 failed
......@@ -107,7 +107,7 @@ class GitCheckoutLoader(BaseDirectoryLoader):
self.git_ref = kwargs.pop("ref")
self.submodules = kwargs.pop("submodules", False)
# We use a filter which ignore the .git folder and the empty git trees
super().__init__(*args, dir_filter=list_git_tree, **kwargs)
super().__init__(*args, path_filter=list_git_tree, **kwargs)
def fetch_artifact(self) -> Iterator[Path]:
with raise_not_found_repository():
......
......@@ -69,7 +69,7 @@ def test_list_git_tree(datadir, tmp_path):
assert empty_bar_found is True
dir2 = Directory.from_disk(path=repo_path, dir_filter=list_git_tree)
dir2 = Directory.from_disk(path=repo_path, path_filter=list_git_tree)
dir2_entries = [d["name"] for d in dir2.entries]
assert b".git" not in dir2_entries
assert b"empty-foo" not in dir2_entries
......@@ -177,8 +177,6 @@ def test_git_loader_directory(swh_storage, datadir, tmp_path, reference):
checksums=checksums,
)
assert loader.dir_filter == list_git_tree
actual_result = loader.load()
assert actual_result == {"status": "eventful"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment