mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-12 13:22:55 +02:00
Fix
This commit is contained in:
parent
f4304547a4
commit
a598a4466b
@ -54,11 +54,10 @@ func CreatePushPullComment(ctx context.Context, pusher *user_model.User, pr *iss
|
|||||||
}
|
}
|
||||||
|
|
||||||
opts := &issues_model.CreateCommentOptions{
|
opts := &issues_model.CreateCommentOptions{
|
||||||
Type: issues_model.CommentTypePullRequestPush,
|
Type: issues_model.CommentTypePullRequestPush,
|
||||||
Doer: pusher,
|
Doer: pusher,
|
||||||
Repo: pr.BaseRepo,
|
Repo: pr.BaseRepo,
|
||||||
IsForcePush: isForcePush,
|
Issue: pr.Issue,
|
||||||
Issue: pr.Issue,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var data issues_model.PushActionContent
|
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.CommitIDs = []string{oldCommitID, newCommitID}
|
||||||
data.IsForcePush = true
|
data.IsForcePush = true
|
||||||
dataJSON, err := json.Marshal(data)
|
dataJSON, err := json.Marshal(data)
|
||||||
@ -101,6 +100,7 @@ func CreatePushPullComment(ctx context.Context, pusher *user_model.User, pr *iss
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
opts.Content = string(dataJSON)
|
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)
|
comment, err = issues_model.CreateComment(ctx, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user