Skip to content

Commit 860121d

Browse files
committed
Fix comment and bug
1 parent 0e306f7 commit 860121d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

routers/private/hook_post_receive.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,14 @@ func loadContextCacheUser(ctx context.Context, id int64) (*user_model.User, erro
327327
})
328328
}
329329

330-
// handlePullRequestMerging handle pull request merging, a pull request action should only push 1 commit
330+
// handlePullRequestMerging handle pull request merging, a pull request action should push at least 1 commit
331331
func handlePullRequestMerging(ctx *gitea_context.PrivateContext, opts *private.HookOptions, ownerName, repoName string, updates []*repo_module.PushUpdateOptions) {
332332
if len(updates) == 0 {
333333
ctx.JSON(http.StatusInternalServerError, private.HookPostReceiveResult{
334334
Err: fmt.Sprintf("Pushing a merged PR (pr:%d) no commits pushed ", opts.PullRequestID),
335335
})
336336
return
337337
}
338-
if len(updates) != 1 && !setting.IsProd {
339-
// it shouldn't happen
340-
panic(fmt.Sprintf("Pushing a merged PR (pr:%d) should only push 1 commit, but got %d", opts.PullRequestID, len(updates)))
341-
}
342338

343339
pr, err := issues_model.GetPullRequestByID(ctx, opts.PullRequestID)
344340
if err != nil {

0 commit comments

Comments
 (0)