From 91150442190242736d1062014db47cbfb39565cc Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Sun, 29 Mar 2026 09:36:53 -0700 Subject: [PATCH] spork-create: check for conflicting branch names before sporking Bail if upstream already has branches named 'blumeops' or 'deploy', which would conflict with the spork branch naming strategy. Co-Authored-By: Claude Opus 4.6 (1M context) --- mise-tasks/spork-create | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mise-tasks/spork-create b/mise-tasks/spork-create index 4aed2b1..84d2999 100755 --- a/mise-tasks/spork-create +++ b/mise-tasks/spork-create @@ -272,6 +272,21 @@ def main( ) raise SystemExit(1) + # Verify upstream doesn't have branches that conflict with spork names + for reserved in ("blumeops", "deploy"): + resp = forge_api( + client, + "GET", + f"/repos/{MIRROR_ORG}/{repo_name}/branches/{reserved}", + token, + ) + if resp.status_code == 200: + console.print( + f"[red]Error:[/red] Upstream already has a branch named " + f"[bold]{reserved}[/bold] — this conflicts with the spork strategy." + ) + raise SystemExit(1) + console.print(f" Mirror: {MIRROR_ORG}/{repo_name}") console.print(f" Upstream: {upstream_url}") console.print(f" Main branch: {detected_main}")