Support auto detecting branch for PRs #525

Open
harryzcy wants to merge 17 commits from harryzcy/tea:fix-524 into main
Showing only changes of commit e4ff7b8397 - Show all commits

@ -61,7 +61,7 @@ var CmdPullsMerge = cli.Command{
return err return err
} }
idx, err = GetPullIndexByBranch(ctx, branch) idx, err = getPullIndexByBranch(ctx, branch)
if err != nil { if err != nil {
return err return err
} }
@ -83,7 +83,7 @@ var CmdPullsMerge = cli.Command{
}, },
} }
func GetPullIndexByBranch(ctx *context.TeaContext, branch string) (int64, error) { func getPullIndexByBranch(ctx *context.TeaContext, branch string) (int64, error) {
prs, _, err := ctx.Login.Client().ListRepoPullRequests(ctx.Owner, ctx.Repo, gitea.ListPullRequestsOptions{ prs, _, err := ctx.Login.Client().ListRepoPullRequests(ctx.Owner, ctx.Repo, gitea.ListPullRequestsOptions{
State: gitea.StateOpen, State: gitea.StateOpen,
}) })