INNER CODE UNIT · Python
text
pineforge-4pass/pineforge-engine · benchmarks/check_provenance.py:102
def text(self, path: str) -> str:
return self.bytes(path).decode("utf-8")
def json(self, path: str):
return json.loads(self.bytes(path))
def files(self, directory: str) -> list[str]:
res = (self._git("ls-tree", "-r", "--name-only", self.rev, directory) if self.rev
else self._git("ls-files", directory))
return res.stdout.split()
def pinned(self, commit: str, path: str) -> str:
self.reads.append(f"{commit}:{path}")
res = self._git("show", f"{commit}:{path}")
if res.returncode:
raise Unsourced(f"pinned {commit}:{path} is not in this clone")
return res.stdout