aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go6
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
}