diff options
author | 6543 <6543@obermui.de> | 2022-05-03 21:46:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 21:46:28 +0200 |
commit | 92f139d091c906cc6d30599101d45c62a208f585 (patch) | |
tree | e7be0dfc3cd9ae0611bd7cfa11cc1ee277e756fd /services/forms/repo_form.go | |
parent | 730420b6b32414db7fcd12ede87712b0f960de7b (diff) | |
download | gitea-92f139d091c906cc6d30599101d45c62a208f585.tar.gz gitea-92f139d091c906cc6d30599101d45c62a208f585.zip |
Use for a repo action one database transaction (#19576)
... more context
(part of #9307)
Diffstat (limited to 'services/forms/repo_form.go')
-rw-r--r-- | services/forms/repo_form.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index f40e99a044..5c3adc1cd3 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -6,6 +6,7 @@ package forms import ( + stdContext "context" "net/http" "net/url" "strings" @@ -601,7 +602,7 @@ func (f *MergePullRequestForm) Validate(req *http.Request, errs binding.Errors) } // SetDefaults if not provided for mergestyle and commit message -func (f *MergePullRequestForm) SetDefaults(pr *models.PullRequest) (err error) { +func (f *MergePullRequestForm) SetDefaults(ctx stdContext.Context, pr *models.PullRequest) (err error) { if f.Do == "" { f.Do = "merge" } @@ -610,9 +611,9 @@ func (f *MergePullRequestForm) SetDefaults(pr *models.PullRequest) (err error) { if len(f.MergeTitleField) == 0 { switch f.Do { case "merge", "rebase-merge": - f.MergeTitleField, err = pr.GetDefaultMergeMessage() + f.MergeTitleField, err = pr.GetDefaultMergeMessage(ctx) case "squash": - f.MergeTitleField, err = pr.GetDefaultSquashMessage() + f.MergeTitleField, err = pr.GetDefaultSquashMessage(ctx) } } |