fix(simulation): scope worker git ownership checks
This commit is contained in:
parent
c9b1009259
commit
fc5cbdff8a
|
|
@ -90,7 +90,17 @@ def _package_version(package: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def _git_commit(path: Path) -> str:
|
def _git_commit(path: Path) -> str:
|
||||||
commit = _run(["git", "-C", str(path), "rev-parse", "HEAD"])
|
commit = _run(
|
||||||
|
[
|
||||||
|
"git",
|
||||||
|
"-c",
|
||||||
|
f"safe.directory={path}",
|
||||||
|
"-C",
|
||||||
|
str(path),
|
||||||
|
"rev-parse",
|
||||||
|
"HEAD",
|
||||||
|
]
|
||||||
|
)
|
||||||
if re.fullmatch(r"[a-f0-9]{40}", commit) is None:
|
if re.fullmatch(r"[a-f0-9]{40}", commit) is None:
|
||||||
raise EvidenceError(f"invalid Git commit at {path}: {commit!r}")
|
raise EvidenceError(f"invalid Git commit at {path}: {commit!r}")
|
||||||
return commit
|
return commit
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue