1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-13 17:58:15 +00:00

Merge branch 'main' into lunny/automerge_support_delete_branch

This commit is contained in:
Lunny Xiao
2024-11-09 18:08:10 -08:00
27 changed files with 515 additions and 272 deletions

View File

@@ -554,7 +554,19 @@ func CreatePullRequest(ctx *context.APIContext) {
}
}
if err := pull_service.NewPullRequest(ctx, repo, prIssue, labelIDs, []string{}, pr, assigneeIDs); err != nil {
prOpts := &pull_service.NewPullRequestOptions{
Repo: repo,
Issue: prIssue,
LabelIDs: labelIDs,
PullRequest: pr,
AssigneeIDs: assigneeIDs,
}
prOpts.Reviewers, prOpts.TeamReviewers = parseReviewersByNames(ctx, form.Reviewers, form.TeamReviewers)
if ctx.Written() {
return
}
if err := pull_service.NewPullRequest(ctx, prOpts); err != nil {
if repo_model.IsErrUserDoesNotHaveAccessToRepo(err) {
ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err)
} else if errors.Is(err, user_model.ErrBlockedUser) {