Always ignore paths in .git

This commit is contained in:
MischaPanch authored and Michael Panchenko committed 2025-07-24 19:45:24 +02:00
1 parent 25139d1d74
commit 81615c4176
2 files changed
+9

No files matched your search

+3
View File
@@ -2,6 +2,9 @@
Status of the `main` branch. Changes prior to the next official version change will appear here.
Fixes:
* Ignore `.git` in check for ignored paths and improve performance of `find_all_non_ignored_files`
# 0.1.3
## Summary
+6
View File
@@ -3,6 +3,7 @@ import logging
import os
from collections.abc import Callable
from dataclasses import dataclass, field
from pathlib import Path
from typing import NamedTuple
import pathspec
@@ -258,6 +259,11 @@ class GitignoreParser:
else:
rel_path = path
# Ignore paths inside .git
rel_path_first_path = Path(rel_path).parts[0]
if rel_path_first_path == ".git":
return True
abs_path = os.path.join(self.repo_root, rel_path)
# Normalize path separators