Fix in Project._is_ignored_relative_path

Check for ignored path ignored `.git` folder only at the top level,
not in every subdirectory

Fixes #1350
This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-04-15 00:18:04 +02:00
1 parent d8178fa2b4
commit a09840156f
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ Status of the `main` branch. Changes prior to the next official version change w
* General:
- Support `serena --version` CLI command for displaying the current version #1347
- Fix: Check for ignored path ignored `.git` folder only at the top level, not in every subdirectory (`Project._is_ignored_relative_path`) #1350
# v1.1.2 (2026-04-14)
+1 -1
View File
@@ -448,7 +448,7 @@ class Project(ToStringMixin):
rel_path = Path(relative_path)
# always ignore paths inside .git
if len(rel_path.parts) > 0 and rel_path.parts[0] == ".git":
if len(rel_path.parts) > 0 and ".git" in rel_path.parts:
return True
return match_path(str(relative_path), self._ignore_spec, root_path=self.project_root)