From a598a4466b6ff7750d4010a91c2f29ccbc6b5bf8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 17 Feb 2026 20:07:34 -0800 Subject: [PATCH] Fix --- services/pull/comment.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/pull/comment.go b/services/pull/comment.go index 31ecd95019..0ad0419441 100644 --- a/services/pull/comment.go +++ b/services/pull/comment.go @@ -54,11 +54,10 @@ func CreatePushPullComment(ctx context.Context, pusher *user_model.User, pr *iss } opts := &issues_model.CreateCommentOptions{ - Type: issues_model.CommentTypePullRequestPush, - Doer: pusher, - Repo: pr.BaseRepo, - IsForcePush: isForcePush, - Issue: pr.Issue, + Type: issues_model.CommentTypePullRequestPush, + Doer: pusher, + Repo: pr.BaseRepo, + Issue: pr.Issue, } var data issues_model.PushActionContent @@ -93,7 +92,7 @@ func CreatePushPullComment(ctx context.Context, pusher *user_model.User, pr *iss } } - if opts.IsForcePush { // if it's a force push, we needs to add a force push comment + if isForcePush { // if it's a force push, we needs to add a force push comment data.CommitIDs = []string{oldCommitID, newCommitID} data.IsForcePush = true dataJSON, err := json.Marshal(data) @@ -101,6 +100,7 @@ func CreatePushPullComment(ctx context.Context, pusher *user_model.User, pr *iss return nil, err } opts.Content = string(dataJSON) + opts.IsForcePush = true // FIXME: it seems the field is unnecessary any more because PushActionContent includes IsForcePush field comment, err = issues_model.CreateComment(ctx, opts) if err != nil { return nil, err