mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-05 21:38:13 +02:00
feat(pulls): support branch-validated stack reordering
Assisted-by: Codet:GPT-5-Codex
This commit is contained in:
@@ -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