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

Function _resolves_under_root

graphify/detect.py:1018–1024  ·  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

1016
1017
1018def _resolves_under_root(path: Path, root: Path) -> bool:
1019 """True when ``path`` resolves to a target inside ``root``."""
1020 try:
1021 path.resolve().relative_to(root.resolve())
1022 except (OSError, RuntimeError, ValueError):
1023 return False
1024 return True
1025
1026
1027def detect(root: Path, *, follow_symlinks: bool | None = None, google_workspace: bool | None = None, extra_excludes: list[str] | None = None) -> dict:

Callers 2

collect_filesFunction · 0.90
detectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected