True when ``path`` resolves to a target inside ``root``.
(path: Path, root: Path)
| 2194 | |
| 2195 | |
| 2196 | def _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 |
no test coverage detected