|
|
@@ -810,6 +810,12 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if form.BlockChainAmount < int(models.PullRequestAmountZero) || form.BlockChainAmount > int(models.PullRequestAmountMax) { |
|
|
|
log.Error("amount set error(0-300)") |
|
|
|
ctx.RenderWithErr("amount set error(0-300)", tplIssueView, form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if err = pull_service.Merge(pr, ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil { |
|
|
|
if models.IsErrInvalidMergeStyle(err) { |
|
|
|
ctx.Flash.Error(ctx.Tr("repo.pulls.invalid_merge_option")) |
|
|
@@ -924,11 +930,6 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if form.Difficulty > int(models.PullRequestDifficultyMax) || form.Difficulty < int(models.PullRequestDifficultyZero) { |
|
|
|
ctx.RenderWithErr(ctx.Tr("the difficulty set error(0-3)"), tplCompareDiff, form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
pullIssue := &models.Issue{ |
|
|
|
RepoID: repo.ID, |
|
|
|
Title: form.Title, |
|
|
@@ -947,7 +948,6 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm) |
|
|
|
BaseRepo: repo, |
|
|
|
MergeBase: prInfo.MergeBase, |
|
|
|
Type: models.PullRequestGitea, |
|
|
|
Difficulty: models.PullRequestDifficulty(form.Difficulty), |
|
|
|
} |
|
|
|
// FIXME: check error in the case two people send pull request at almost same time, give nice error prompt |
|
|
|
// instead of 500. |
|
|
|