Skip to content

Commit

Permalink
Hide push notifications from merged branches
Browse files Browse the repository at this point in the history
Fixes go-gitea#25778

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
dsseng and yp05327 committed Jul 11, 2023
1 parent 2f31d2d commit ce249c5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions models/git/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,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{"issue.is_closed": false},
builder.Eq{"pull_request.has_merged": true},
),
))
err := db.GetEngine(ctx).
Where("pusher_id=? AND is_deleted=?", userID, false).
And("name <> ?", excludeBranchName).
Expand Down

0 comments on commit ce249c5

Please sign in to comment.