|
|
@@ -71,11 +71,18 @@ def lint(path: Path, snapshot: bool = False) -> list[ET.Element]:
|
|
|
|
|
|
def create_snapshot(source: Path, output: Path) -> None:
|
|
|
projects = lint(source)
|
|
|
+ output = output.resolve()
|
|
|
+ checkouts = [(project, (WORKSPACE / project.get("path", "")).resolve()) for project in projects]
|
|
|
+ for project, checkout in checkouts:
|
|
|
+ if output.is_relative_to(checkout):
|
|
|
+ raise ValueError(
|
|
|
+ "snapshot output must be outside every snapshotted repository: "
|
|
|
+ f"{project.get('name')} contains {output}"
|
|
|
+ )
|
|
|
rows: list[tuple[str, str, str, str]] = []
|
|
|
- for project in projects:
|
|
|
+ for project, checkout in checkouts:
|
|
|
name = project.get("name", "")
|
|
|
repo_path = project.get("path", "")
|
|
|
- checkout = WORKSPACE / repo_path
|
|
|
if not (checkout / ".git").exists():
|
|
|
raise ValueError(f"repository missing: {checkout}")
|
|
|
if git(checkout, "status", "--porcelain"):
|