mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
fix: Do not offer duplicating a PR for a recently pushed branch
Fixes #6187.
This commit is contained in:
parent
e248179333
commit
4973d23ef8
2 changed files with 42 additions and 4 deletions
|
@ -417,10 +417,13 @@ func FindRecentlyPushedNewBranches(ctx context.Context, repoID, userID int64, ex
|
|||
branches := make(BranchList, 0, 2)
|
||||
subQuery := builder.Select("head_branch").From("pull_request").
|
||||
InnerJoin("issue", "issue.id = pull_request.issue_id").
|
||||
Where(builder.Eq{
|
||||
"pull_request.head_repo_id": repoID,
|
||||
"issue.is_closed": false,
|
||||
})
|
||||
Where(builder.And(
|
||||
builder.Eq{"pull_request.head_repo_id": repoID},
|
||||
builder.Or(
|
||||
builder.Eq{"pull_request.has_merged": true},
|
||||
builder.Eq{"issue.is_closed": false},
|
||||
),
|
||||
))
|
||||
err := db.GetEngine(ctx).
|
||||
Where("pusher_id=? AND is_deleted=?", userID, false).
|
||||
And("name <> ?", excludeBranchName).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue