(target: Path)
| 168 | |
| 169 | |
| 170 | def git_worktree_context(target: Path) -> tuple[Path, str]: |
| 171 | root = git_output(target, "rev-parse", "--show-toplevel") |
| 172 | if root is None: |
| 173 | raise SystemExit("Could not inspect the selected Git working tree.") |
| 174 | repository = Path(root).resolve() |
| 175 | try: |
| 176 | relative = target.resolve().relative_to(repository) |
| 177 | except ValueError as exc: |
| 178 | raise SystemExit("Scan target must stay inside its Git working tree.") from exc |
| 179 | return repository, relative.as_posix() or "." |
| 180 | |
| 181 | |
| 182 | def git_submodule_entries(target: Path) -> tuple[tuple[Path, str], ...]: |
no test coverage detected