mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-22 01:34:18 +00:00
Use for a repo action one database transaction (#19576)
... more context (part of #9307)
This commit is contained in:
parent
730420b6b3
commit
92f139d091
29 changed files with 270 additions and 260 deletions
|
@ -62,8 +62,8 @@ func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequ
|
|||
|
||||
// HasUnmergedPullRequestsByHeadInfo checks if there are open and not merged pull request
|
||||
// by given head information (repo and branch)
|
||||
func HasUnmergedPullRequestsByHeadInfo(repoID int64, branch string) (bool, error) {
|
||||
return db.GetEngine(db.DefaultContext).
|
||||
func HasUnmergedPullRequestsByHeadInfo(ctx context.Context, repoID int64, branch string) (bool, error) {
|
||||
return db.GetEngine(ctx).
|
||||
Where("head_repo_id = ? AND head_branch = ? AND has_merged = ? AND issue.is_closed = ? AND flow = ?",
|
||||
repoID, branch, false, false, PullRequestFlowGithub).
|
||||
Join("INNER", "issue", "issue.id = pull_request.issue_id").
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue