feat(branch): add +all and +set-default #386

Closed
Taoyouce wants to merge 0 commits from Taoyouce/gitlink-cli:feat/branch-default-all into master
Contributor

What

Two branch-group gaps closed against Api::V1::Projects::BranchesController:

  • branch +all: the full branch-name list via GET /branches/all (AllListService) — no paging, ideal for scripting/completion. +list only returns paged detail objects.
  • branch +set-default -n <name>: switch the repository default branch via PATCH /branches/update_default_branch (manager permission). The CLI previously had no way to change the default branch at all.
gitlink-cli branch +all --owner myname --repo myrepo
gitlink-cli branch +set-default --owner myname --repo myrepo -n develop

Validation

  • Production-verified on gitlink.org.cn: full name list returned; default-branch update returns status: 0 (switched on a fork and restored).
  • 2 unit tests (endpoint paths + PATCH payload); go test ./..., go vet, gofmt all clean.
  • README examples and bilingual i18n keys included.
## What Two branch-group gaps closed against `Api::V1::Projects::BranchesController`: - `branch +all`: the full branch-name list via `GET /branches/all` (`AllListService`) — no paging, ideal for scripting/completion. `+list` only returns paged detail objects. - `branch +set-default -n <name>`: switch the repository default branch via `PATCH /branches/update_default_branch` (manager permission). The CLI previously had no way to change the default branch at all. ```bash gitlink-cli branch +all --owner myname --repo myrepo gitlink-cli branch +set-default --owner myname --repo myrepo -n develop ``` ## Validation - Production-verified on gitlink.org.cn: full name list returned; default-branch update returns `status: 0` (switched on a fork and restored). - 2 unit tests (endpoint paths + PATCH payload); `go test ./...`, `go vet`, `gofmt` all clean. - README examples and bilingual i18n keys included.
Taoyouce added 4 commits 2026-07-08 22:45:04 +08:00
f0e72d8a6c feat(branch): add +all and +set-default
- branch +all: full branch-name list via GET /branches/all
  (AllListService), no paging — handy for scripting and completion.
- branch +set-default: switch the repository default branch via
  PATCH /branches/update_default_branch (manager permission),
  which the CLI previously had no way to do.

Production-verified on gitlink.org.cn (full name list returned;
default branch update status 0). 2 unit tests, README examples,
bilingual i18n keys.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
wbtiger closed this pull request 2026-07-14 22:04:11 +08:00
wbtiger reopened this pull request 2026-07-14 23:03:40 +08:00
wbtiger closed this pull request 2026-07-14 23:09:26 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#386
No description provided.