0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-18 21:50:01 +01:00

Add missing two sync feed for refs/pull (#32815)

Fowllow #32659
This commit is contained in:
Lunny Xiao 2024-12-12 20:22:39 -08:00 committed by GitHub
parent 2910f384d5
commit 887928e0a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -417,6 +417,12 @@ func (a *actionNotifier) SyncPushCommits(ctx context.Context, pusher *user_model
} }
func (a *actionNotifier) SyncCreateRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) { func (a *actionNotifier) SyncCreateRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) {
// ignore pull sync message for pull requests refs
// TODO: it's better to have a UI to let users chose
if refFullName.IsPull() {
return
}
if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{ if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{
ActUserID: repo.OwnerID, ActUserID: repo.OwnerID,
ActUser: repo.MustOwner(ctx), ActUser: repo.MustOwner(ctx),
@ -431,6 +437,12 @@ func (a *actionNotifier) SyncCreateRef(ctx context.Context, doer *user_model.Use
} }
func (a *actionNotifier) SyncDeleteRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName) { func (a *actionNotifier) SyncDeleteRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName) {
// ignore pull sync message for pull requests refs
// TODO: it's better to have a UI to let users chose
if refFullName.IsPull() {
return
}
if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{ if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{
ActUserID: repo.OwnerID, ActUserID: repo.OwnerID,
ActUser: repo.MustOwner(ctx), ActUser: repo.MustOwner(ctx),