Skip to content

Commit ce249c5

Browse files
dssengyp05327
andcommitted
Hide push notifications from merged branches
Fixes go-gitea#25778 Co-authored-by: yp05327 <[email protected]>
1 parent 2f31d2d commit ce249c5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

models/git/branch.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,13 @@ func FindRecentlyPushedNewBranches(ctx context.Context, repoID, userID int64, ex
387387
branches := make(BranchList, 0, 2)
388388
subQuery := builder.Select("head_branch").From("pull_request").
389389
InnerJoin("issue", "issue.id = pull_request.issue_id").
390-
Where(builder.Eq{
391-
"pull_request.head_repo_id": repoID,
392-
"issue.is_closed": false,
393-
})
390+
Where(builder.And(
391+
builder.Eq{"pull_request.head_repo_id": repoID},
392+
builder.Or(
393+
builder.Eq{"issue.is_closed": false},
394+
builder.Eq{"pull_request.has_merged": true},
395+
),
396+
))
394397
err := db.GetEngine(ctx).
395398
Where("pusher_id=? AND is_deleted=?", userID, false).
396399
And("name <> ?", excludeBranchName).

0 commit comments

Comments
 (0)