test(project-scanner): tighten git helper env handling

Agent-Logs-Url: https://github.com/MemPalace/mempalace/sessions/3c277c46-20b3-4a43-8eb7-8ee2eb3cb55a

Co-authored-by: igorls <4753812+igorls@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-24 03:50:13 +00:00
committed by GitHub
parent 70d4c5471e
commit 851ebebc29
2 changed files with 14 additions and 9 deletions
+1 -4
View File
@@ -296,10 +296,7 @@ def _looks_like_real_name(name: str) -> bool:
def _walk(root: Path, max_depth: int = MAX_DEPTH):
for dirpath, dirs, files in os.walk(root):
dirs[:] = [d for d in dirs if d not in SKIP_DIRS and not d.startswith(".")]
try:
rel = Path(dirpath).relative_to(root)
except ValueError:
continue
rel = Path(dirpath).relative_to(root)
depth = 0 if rel == Path(".") else len(rel.parts)
if depth > max_depth:
dirs.clear()