diff --git a/beet/core/container.py b/beet/core/container.py index 2e795b1f..093636ad 100644 --- a/beet/core/container.py +++ b/beet/core/container.py @@ -66,7 +66,7 @@ def merge( class MatchMixin: def match(self: Mapping[str, Any], *patterns: str) -> Set[str]: """Return keys matching the given path patterns.""" - spec = PathSpec.from_lines("gitwildmatch", patterns or ["*"]) + spec = PathSpec.from_lines("gitwildmatch", patterns) return set(spec.match_files(self.keys())) diff --git a/tests/test_data_pack.py b/tests/test_data_pack.py index 56784039..724bc212 100644 --- a/tests/test_data_pack.py +++ b/tests/test_data_pack.py @@ -184,7 +184,9 @@ def test_match(): funcs = [f"path/to/func_{i:02d}" for i in range(100)] - assert custom.functions.match() == set(funcs) | { + assert custom.functions.match() == set() + + assert custom.functions.match("*") == set(funcs) | { "path/to/end", "other/subdir/hello", "other/subdir/world", @@ -227,7 +229,9 @@ def test_proxy_match(): custom_funcs = [f"custom:path/to/func_{i:02d}" for i in range(100)] hey_funcs = [f"hey:path/to/func_{i:02d}" for i in range(100)] - assert pack.functions.match() == set(custom_funcs) | set(hey_funcs) | { + assert pack.functions.match() == set() + + assert pack.functions.match("*") == set(custom_funcs) | set(hey_funcs) | { "custom:path/to/end", "custom:other/subdir/hello", "custom:other/subdir/world",