(project_path: Path, dest: Path)
| 148 | |
| 149 | |
| 150 | def _shared_relative_path(project_path: Path, dest: Path) -> Path: |
| 151 | try: |
| 152 | rel = dest.relative_to(project_path) |
| 153 | except ValueError: |
| 154 | label = _shared_destination_label(project_path, dest) |
| 155 | raise ValueError(f"Shared infrastructure path escapes project root: {label}") from None |
| 156 | |
| 157 | if rel.is_absolute() or ".." in rel.parts: |
| 158 | label = _shared_destination_label(project_path, dest) |
| 159 | raise ValueError(f"Shared infrastructure path escapes project root: {label}") |
| 160 | return rel |
| 161 | |
| 162 | |
| 163 | def _ensure_safe_shared_directory( |
no test coverage detected