This make checks in one single place so they dont differ and maintainer can not forget a check in one place while adding it to the other .... ( as it's atm )
Fix:
* The API does ignore issue dependencies where Web does not
* The API checks if "IsSignedIfRequired" where Web does not - UI probably do but nothing will some to craft custom requests
* Default merge message is crafted a bit different between API and Web if not set on specific cases ...
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch)
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadBranch,pr.BaseBranch),nil
}
}
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseBranch)
returnfmt.Sprintf("Merge pull request '%s' (%s%d) from %s:%s into %s",pr.Issue.Title,issueReference,pr.Issue.Index,pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseBranch),nil
ctx.Error(http.StatusMethodNotAllowed,"Invalid merge style",fmt.Errorf("%s is not allowed an allowed merge style for this repository",repo_model.MergeStyle(form.Do)))
ctx.Error(http.StatusMethodNotAllowed,"Invalid merge style",fmt.Errorf("%s is not allowed an allowed merge style for this repository",repo_model.MergeStyle(form.Do)))
ctx.Error(http.StatusMethodNotAllowed,"Invalid merge style",fmt.Errorf("%s is not allowed an allowed merge style for this repository",repo_model.MergeStyle(form.Do)))
ctx.Error(http.StatusMethodNotAllowed,"Invalid merge style",fmt.Errorf("%s is not allowed an allowed merge style for this repository",repo_model.MergeStyle(form.Do)))
log.Warn("Forbidden: User %d is not allowed push to protected branch %s in %-v and pr #%d is not ready to be merged: %s",ctx.opts.UserID,branchName,repo,pr.Index,err.Error())
log.Warn("Forbidden: User %d is not allowed push to protected branch %s in %-v and pr #%d is not ready to be merged: %s",ctx.opts.UserID,branchName,repo,pr.Index,err.Error())
ctx.JSON(http.StatusForbidden,private.Response{
ctx.JSON(http.StatusForbidden,private.Response{
Err:fmt.Sprintf("Not allowed to push to protected branch %s and pr #%d is not ready to be merged: %s",branchName,ctx.opts.PullRequestID,err.Error()),
Err:fmt.Sprintf("Not allowed to push to protected branch %s and pr #%d is not ready to be merged: %s",branchName,ctx.opts.PullRequestID,err.Error()),