mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 23:20:04 +00:00
feat(pulls): support branch-validated stack reordering
Assisted-by: Codet:GPT-5-Codex
This commit is contained in:
1 parent
f28a5e696a
commit
b06d902687
5 files changed
+103
-1
No files matched your search
@@ -120,6 +120,19 @@ func AddPullStackEntry(ctx stdctx.Context, login *config.Login, owner, repo stri
|
||||
return &s, nil
|
||||
}
|
||||
|
||||
// ReorderPullStack records the order of PR branches that are already linked.
|
||||
func ReorderPullStack(ctx stdctx.Context, login *config.Login, owner, repo string, id int64, pullIndices []int64) (*stack.Stack, error) {
|
||||
var s stack.Stack
|
||||
err := postStackJSON(ctx, login, fmt.Sprintf("/repos/%s/%s/stacks/%d/reorder", owner, repo, id),
|
||||
struct {
|
||||
PullIndices []int64 `json:"pull_indices"`
|
||||
}{PullIndices: pullIndices}, http.StatusOK, &s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &s, nil
|
||||
}
|
||||
|
||||
// RestackPullStack queues a restack starting at the stack's base branch.
|
||||
func RestackPullStack(ctx stdctx.Context, login *config.Login, owner, repo string, id int64) error {
|
||||
client := api.NewClient(login)
|
||||
|
||||
Reference in new issue
Block a user