MCPcopy Index your code
hub / github.com/gogs/gogs / checkAndUpdateStatus

Method checkAndUpdateStatus

internal/database/pull.go:823–835  ·  view source on GitHub ↗

checkAndUpdateStatus checks if pull request is possible to leaving checking status, and set to be either conflict or mergeable.

()

Source from the content-addressed store, hash-verified

821// checkAndUpdateStatus checks if pull request is possible to leaving checking status,
822// and set to be either conflict or mergeable.
823func (pr *PullRequest) checkAndUpdateStatus() {
824 // Status is not changed to conflict means mergeable.
825 if pr.Status == PullRequestStatusChecking {
826 pr.Status = PullRequestStatusMergeable
827 }
828
829 // Make sure there is no waiting test to process before leaving the checking status.
830 if !PullRequestQueue.Exist(pr.ID) {
831 if err := pr.UpdateCols("status"); err != nil {
832 log.Error("Update[%d]: %v", pr.ID, err)
833 }
834 }
835}
836
837// TestPullRequests checks and tests untested patches of pull requests.
838// TODO: test more pull requests at same time.

Callers 1

TestPullRequestsFunction · 0.80

Calls 3

UpdateColsMethod · 0.95
ExistMethod · 0.80
ErrorMethod · 0.45

Tested by 1

TestPullRequestsFunction · 0.64