refactor: remove redundant pathspec check (#2384)

This commit is contained in:
doodleEsc
2025-07-02 12:17:41 +08:00
committed by GitHub
parent 6bfd792a64
commit 6bbf3d2004

View File

@@ -682,10 +682,6 @@ def get_pathspec(directory: Path) -> pathspec.PathSpec | None:
patterns = get_gitignore_files(directory)
patterns.extend(get_gitcrypt_files(directory))
# Return None if no patterns were found
if len(patterns) <= 1: # Only .git/ is in the list
return None
return pathspec.GitIgnoreSpec.from_lines(patterns)