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

Function GetUnmergedPullRequestsByBaseInfo

internal/database/pull.go:547–552  ·  view source on GitHub ↗

GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged by given base information (repo and branch).

(repoID int64, branch string)

Source from the content-addressed store, hash-verified

545// GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged
546// by given base information (repo and branch).
547func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error) {
548 prs := make([]*PullRequest, 0, 2)
549 return prs, x.Where("base_repo_id=? AND base_branch=? AND has_merged=? AND issue.is_closed=?",
550 repoID, branch, false, false).
551 Join("INNER", "issue", "issue.id=pull_request.issue_id").Find(&prs)
552}
553
554var _ errutil.NotFound = (*ErrPullRequestNotExist)(nil)
555

Callers 1

AddTestPullRequestTaskFunction · 0.85

Calls 2

WhereMethod · 0.80
FindMethod · 0.65

Tested by

no test coverage detected