diff options
author | 赵智超 <1012112796@qq.com> | 2020-04-14 09:06:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 09:06:23 +0800 |
commit | 281029529bf98218b6c75353f2fce2d74b7ba196 (patch) | |
tree | c88354f13b20ddd024b167117c50a57cd11d92b7 /models/issue.go | |
parent | 063b1d260fa5559fac0b77c215e8b06a9c083cec (diff) | |
download | gitea-281029529bf98218b6c75353f2fce2d74b7ba196.tar.gz gitea-281029529bf98218b6c75353f2fce2d74b7ba196.zip |
ui: Add MergePull comment type instead of close for merge PR (#11058)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go index ba211e9670..17ec0a6888 100644 --- a/models/issue.go +++ b/models/issue.go @@ -554,7 +554,7 @@ func updateIssueCols(e Engine, issue *Issue, cols ...string) error { return nil } -func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (*Comment, error) { +func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed, isMergePull bool) (*Comment, error) { // Reload the issue currentIssue, err := getIssueByID(e, issue.ID) if err != nil { @@ -620,6 +620,8 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (*C cmtType := CommentTypeClose if !issue.IsClosed { cmtType = CommentTypeReopen + } else if isMergePull { + cmtType = CommentTypeMergePull } return createComment(e, &CreateCommentOptions{ @@ -645,7 +647,7 @@ func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (*Comment, error) { return nil, err } - comment, err := issue.changeStatus(sess, doer, isClosed) + comment, err := issue.changeStatus(sess, doer, isClosed, false) if err != nil { return nil, err } |