From 5d837935f4e244e1aef5d6696456117d748c786b Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sat, 9 Nov 2024 21:06:11 -0700 Subject: [PATCH] Return empty list if project root is ignored We need to return an empty list in the event the project root is ignored by a pattern as the project root being ignored means the ignore patterns are not valid for the project. --- backend/src/hatchling/builders/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/hatchling/builders/config.py b/backend/src/hatchling/builders/config.py index 059e67f2a..ff0dc58fa 100644 --- a/backend/src/hatchling/builders/config.py +++ b/backend/src/hatchling/builders/config.py @@ -788,7 +788,7 @@ def load_vcs_exclusion_patterns(self) -> list[str]: # validate project root is not excluded by vcs exclude_spec = pathspec.GitIgnoreSpec.from_lines(patterns) if exclude_spec.match_file(self.root): - return patterns + return [] return patterns