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) <noreply@anthropic.com>
This commit is contained in:
parent
99df78664e
commit
9115044219
1 changed files with 15 additions and 0 deletions
|
|
@ -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}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue