mirror of https://github.com/go-gitea/gitea.git
Fix comment and bug
This commit is contained in:
parent
0e306f76da
commit
860121db9f
|
@ -327,7 +327,7 @@ func loadContextCacheUser(ctx context.Context, id int64) (*user_model.User, erro
|
|||
})
|
||||
}
|
||||
|
||||
// handlePullRequestMerging handle pull request merging, a pull request action should only push 1 commit
|
||||
// handlePullRequestMerging handle pull request merging, a pull request action should push at least 1 commit
|
||||
func handlePullRequestMerging(ctx *gitea_context.PrivateContext, opts *private.HookOptions, ownerName, repoName string, updates []*repo_module.PushUpdateOptions) {
|
||||
if len(updates) == 0 {
|
||||
ctx.JSON(http.StatusInternalServerError, private.HookPostReceiveResult{
|
||||
|
@ -335,10 +335,6 @@ func handlePullRequestMerging(ctx *gitea_context.PrivateContext, opts *private.H
|
|||
})
|
||||
return
|
||||
}
|
||||
if len(updates) != 1 && !setting.IsProd {
|
||||
// it shouldn't happen
|
||||
panic(fmt.Sprintf("Pushing a merged PR (pr:%d) should only push 1 commit, but got %d", opts.PullRequestID, len(updates)))
|
||||
}
|
||||
|
||||
pr, err := issues_model.GetPullRequestByID(ctx, opts.PullRequestID)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue