diff options
Diffstat (limited to 'services/forms/repo_form.go')
-rw-r--r-- | services/forms/repo_form.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index bacee9a13c..6c61ed00ec 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -6,7 +6,6 @@ package forms import ( - stdContext "context" "net/http" "net/url" "strings" @@ -602,31 +601,6 @@ func (f *MergePullRequestForm) Validate(req *http.Request, errs binding.Errors) return middleware.Validate(errs, ctx.Data, f, ctx.Locale) } -// SetDefaults if not provided for mergestyle and commit message -func (f *MergePullRequestForm) SetDefaults(ctx stdContext.Context, pr *models.PullRequest) (err error) { - if f.Do == "" { - f.Do = "merge" - } - - f.MergeTitleField = strings.TrimSpace(f.MergeTitleField) - if len(f.MergeTitleField) == 0 { - switch f.Do { - case "merge", "rebase-merge": - f.MergeTitleField, err = pr.GetDefaultMergeMessage(ctx) - case "squash": - f.MergeTitleField, err = pr.GetDefaultSquashMessage(ctx) - } - } - - f.MergeMessageField = strings.TrimSpace(f.MergeMessageField) - if len(f.MergeMessageField) > 0 { - f.MergeTitleField += "\n\n" + f.MergeMessageField - f.MergeMessageField = "" - } - - return -} - // CodeCommentForm form for adding code comments for PRs type CodeCommentForm struct { Origin string `binding:"Required;In(timeline,diff)"` |