test(project-scanner): harden git helper execution

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:52:37 +00:00
committed by GitHub
parent ec9084f4d8
commit d4cc367261
2 changed files with 20 additions and 8 deletions
+4
View File
@@ -170,6 +170,7 @@ MANIFEST_PRIORITY = {
"Cargo.toml": 2,
"go.mod": 3,
}
# Sentinel so unknown manifests always sort after the known manifest types above.
UNKNOWN_MANIFEST_PRIORITY = 999
MANIFEST_PARSERS = {
"package.json": _parse_package_json,
@@ -311,6 +312,9 @@ def _has_git_marker(path: Path) -> bool:
def _manifest_sort_key(entry: tuple[str, str, Path], repo_root: Path) -> tuple[int, int, str]:
"""Sort manifests by shallowest path first, then known manifest priority,
then lexicographic path for deterministic tie-breaking.
"""
manifest_file, _project_name, manifest_dir = entry
try:
rel = manifest_dir.relative_to(repo_root)