1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

#2697 fix panic when close issue via commit message

This commit is contained in:
Unknwon
2016-02-25 14:17:55 -05:00
parent 4438b7793b
commit 129638117f
7 changed files with 11 additions and 12 deletions

View File

@@ -218,7 +218,7 @@ func (i *Issue) ReadBy(uid int64) error {
return UpdateIssueUserByRead(uid, i.ID)
}
func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) {
func (i *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository, isClosed bool) (err error) {
if i.IsClosed == isClosed {
return nil
}
@@ -251,7 +251,7 @@ func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err er
}
// New action comment.
if _, err = createStatusComment(e, doer, i.Repo, i); err != nil {
if _, err = createStatusComment(e, doer, repo, i); err != nil {
return err
}
@@ -259,14 +259,14 @@ func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err er
}
// ChangeStatus changes issue status to open/closed.
func (i *Issue) ChangeStatus(doer *User, isClosed bool) (err error) {
func (i *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (err error) {
sess := x.NewSession()
defer sessionRelease(sess)
if err = sess.Begin(); err != nil {
return err
}
if err = i.changeStatus(sess, doer, isClosed); err != nil {
if err = i.changeStatus(sess, doer, repo, isClosed); err != nil {
return err
}