MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _resolves_under_root

Function _resolves_under_root

graphify/detect.py:2196–2202  ·  view source on GitHub ↗

True when ``path`` resolves to a target inside ``root``.

(path: Path, root: Path)

Source from the content-addressed store, hash-verified

2194
2195
2196def _resolves_under_root(path: Path, root: Path) -> bool:
2197 """True when ``path`` resolves to a target inside ``root``."""
2198 try:
2199 resolve_cached(path).relative_to(_resolved_root(root))
2200 except (OSError, RuntimeError, ValueError):
2201 return False
2202 return True
2203
2204
2205# Root -> its resolved form, per detect() run. detect() resolves the same root

Callers 3

collect_filesFunction · 0.90
_ignoredFunction · 0.85
detectFunction · 0.85

Calls 2

resolve_cachedFunction · 0.90
_resolved_rootFunction · 0.85

Tested by

no test coverage detected