summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-02 11:13:37 -0400
committerUnknwon <u@gogs.io>2015-09-02 11:13:37 -0400
commit5da306c0e5a2939b836d5ec00a0984a2c30e0f9f (patch)
tree6b4632617336a3536fddbe31ad50aab9f389580e /models/issue.go
parentd951824ff9c52919e2821d0e9be2504550a994fc (diff)
downloadgitea-5da306c0e5a2939b836d5ec00a0984a2c30e0f9f.tar.gz
gitea-5da306c0e5a2939b836d5ec00a0984a2c30e0f9f.zip
tmp: fix issue open count
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/models/issue.go b/models/issue.go
index 9810a2595a..fff33cf369 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -903,16 +903,15 @@ func (pr *PullRequest) AfterSet(colName string, _ xorm.Cell) {
}
// Merge merges pull request to base repository.
-func (pr *PullRequest) Merge(baseGitRepo *git.Repository) (err error) {
+func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error) {
sess := x.NewSession()
defer sessionRelease(sess)
if err = sess.Begin(); err != nil {
return err
}
- pr.Pull.IsClosed = true
- if _, err = sess.Id(pr.Pull.ID).AllCols().Update(pr.Pull); err != nil {
- return fmt.Errorf("update pull: %v", err)
+ if err = pr.Pull.changeStatus(sess, doer, true); err != nil {
+ return fmt.Errorf("Pull.changeStatus: %v", err)
}
headRepoPath := RepoPath(pr.HeadUserName, pr.HeadRepo.Name)