From cffbb81036f2b3ef021e3b2556cb8208dcc71adf Mon Sep 17 00:00:00 2001 From: Gabriel Terwesten Date: Fri, 8 Aug 2025 19:45:40 +0200 Subject: [PATCH] fix: discover all `.gitignore` files in project Before this change only `.gitignore` files at the project root and its direct subdirectories where found. --- src/serena/util/file_system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/serena/util/file_system.py b/src/serena/util/file_system.py index 4c667b0d..6f2aaa5f 100644 --- a/src/serena/util/file_system.py +++ b/src/serena/util/file_system.py @@ -141,7 +141,8 @@ class GitignoreParser: :return: List of absolute paths to .gitignore files """ - return glob.glob(self.repo_root + "/.gitignore") + glob.glob(self.repo_root + "/**/.gitignore") + relative_paths = glob.glob("**/.gitignore", root_dir=self.repo_root, recursive=True) + return [os.path.join(self.repo_root, rel_path) for rel_path in relative_paths] def _create_ignore_spec(self, gitignore_file_path: str) -> GitignoreSpec: """