From a09840156f798e32b9f90dcf782ac1d5b2f8bb98 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 15 Apr 2026 00:16:45 +0200 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + src/serena/project.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 768f6260..48beba24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/serena/project.py b/src/serena/project.py index a20623e3..6f1cec43 100644 --- a/src/serena/project.py +++ b/src/serena/project.py @@ -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)