summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-23 12:54:19 -0400
committerUnknwon <u@gogs.io>2015-10-23 12:54:19 -0400
commite0aab4a7f6c1f1b5cc7fa40e2c09623b635bc4a6 (patch)
tree7ce9698b096ec80a7e2c050bb1298671bd333a41 /models
parentdb7ac8bc1d4cfb2890a11784d49814c230a7b3e6 (diff)
downloadgitea-e0aab4a7f6c1f1b5cc7fa40e2c09623b635bc4a6.tar.gz
gitea-e0aab4a7f6c1f1b5cc7fa40e2c09623b635bc4a6.zip
#1830 new comment with status change overwrites issue content
Diffstat (limited to 'models')
-rw-r--r--models/issue.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index f1844d2b9e..0b14c5838a 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -233,7 +233,7 @@ func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err er
}
i.IsClosed = isClosed
- if err = updateIssue(e, i); err != nil {
+ if err = updateIssueCols(e, i, "is_closed"); err != nil {
return err
} else if err = updateIssueUsersByStatus(e, i.ID, isClosed); err != nil {
return err
@@ -813,11 +813,18 @@ func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen
return numOpen, numClosed
}
+// updateIssue updates all fields of given issue.
func updateIssue(e Engine, issue *Issue) error {
_, err := e.Id(issue.ID).AllCols().Update(issue)
return err
}
+// updateIssueCols update specific fields of given issue.
+func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
+ _, err := e.Id(issue.ID).Cols(cols...).Update(issue)
+ return err
+}
+
// UpdateIssue updates information of issue.
func UpdateIssue(issue *Issue) error {
return updateIssue(x, issue)