def METHOD_NAME(repo: PathLike, ref: str) -> str:
    """Resolve an OSTree reference `ref` in the repository at `repo`"""
    repo = os.fspath(repo)
    if isinstance(repo, bytes):
        repo = repo.decode("utf8")
    r = subprocess.run(["ostree", "rev-parse", ref, f"--repo={repo}"],
                       encoding="utf8",
                       stdout=subprocess.PIPE,
                       stderr=subprocess.STDOUT,
                       check=False)
    msg = r.stdout.strip()
    if r.returncode != 0:
        raise RuntimeError(msg)
    return msg