feat(branch): branch from tags and commits, protect with explicit rules

branch create --source v1.0.0 (or a commit) failed with "The old branch
does not exist" because only old_branch_name was sent; the request now
sends old_ref_name, through a raw call until the SDK has the field.

branch protect nope exited 0 and created a rule for a missing branch,
and protecting twice failed with "permission denied". Branches must now
exist (--pattern protects a glob instead), an existing rule warns
"! main is already protected", and unprotecting an unprotected branch
warns instead of failing. The rule is explained in help and set with
--required-approvals, --allow-push, --status-check,
--block-on-rejected-reviews and --dismiss-stale-approvals.

branch list shows NAME (marking the default branch), COMMIT, PROTECTED,
UPDATED and MESSAGE, branch view is a full view with --web, branch
delete takes several branches, and every change reports a ✓ line.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-11 23:52:02 +02:00
1 parent 682c9f66a2
commit 02cf01093f
8 files changed
+555 -131

No files matched your search

-8
View File
@@ -419,13 +419,6 @@ const (
pr review cancel-request
`
examplesToWrite = `
branch create
branch delete
branch list
branch protect
branch rename
branch unprotect
branch view
issue attachment delete
issue attachment download
issue attachment edit
@@ -520,7 +513,6 @@ const (
wiki view
`
longsToWrite = `
branch
issue
issue attachment
issue comment