diff options
| author | main <main@swarm.moe> | 2026-04-25 15:31:40 -0400 |
|---|---|---|
| committer | main <main@swarm.moe> | 2026-04-25 15:31:40 -0400 |
| commit | 387665af0412ab5892e2883a707492a30aee01f8 (patch) | |
| tree | e790b8353ed47e61ea407aaf2d353a27934998e6 /publish.py | |
| parent | 679e8eca366242f725987edc7b7d7169435dd1b3 (diff) | |
| download | memview-387665af0412ab5892e2883a707492a30aee01f8.zip | |
Verify publish remotes without tracking refs
Diffstat (limited to 'publish.py')
| -rwxr-xr-x | publish.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -26,12 +26,12 @@ def require_clean_worktree() -> None: raise SystemExit(1) -def sync_tracking_ref(remote: str) -> None: +def verify_remote(remote: str) -> None: head = output("git", "ls-remote", remote, "refs/heads/main").split()[0] local = output("git", "rev-parse", "HEAD") if head != local: raise SystemExit(f"[publish] {remote}/main is {head}, expected {local}") - run("git", "update-ref", f"refs/remotes/{remote}/main", head) + print(f"[publish] verified {remote}/main {head}", flush=True) def main() -> None: @@ -39,9 +39,9 @@ def main() -> None: run("./check.py", "install") require_clean_worktree() run("git", "push", "--follow-tags", "swarm", "main") - sync_tracking_ref("swarm") + verify_remote("swarm") run("git", "push", "--follow-tags", "github", "main") - sync_tracking_ref("github") + verify_remote("github") if __name__ == "__main__": |