MCPcopy Create free account
hub / github.com/gogs/gogs / changeMilestoneIssueStats

Function changeMilestoneIssueStats

internal/database/milestone.go:249–268  ·  view source on GitHub ↗
(e *xorm.Session, issue *Issue)

Source from the content-addressed store, hash-verified

247}
248
249func changeMilestoneIssueStats(e *xorm.Session, issue *Issue) error {
250 if issue.MilestoneID == 0 {
251 return nil
252 }
253
254 m, err := getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID)
255 if err != nil {
256 return err
257 }
258
259 if issue.IsClosed {
260 m.NumOpenIssues--
261 m.NumClosedIssues++
262 } else {
263 m.NumOpenIssues++
264 m.NumClosedIssues--
265 }
266
267 return updateMilestone(e, m)
268}
269
270// ChangeMilestoneIssueStats updates the open/closed issues counter and progress
271// for the milestone associated with the given issue.

Callers 2

changeStatusMethod · 0.85

Calls 2

getMilestoneByRepoIDFunction · 0.85
updateMilestoneFunction · 0.85

Tested by

no test coverage detected