@@ -13,7 +13,7 @@ import (
13
13
api "code.gitea.io/gitea/modules/structs"
14
14
)
15
15
16
- func mirrorSyncAction (opType models.ActionType , repo * models.Repository , refName string , data []byte ) error {
16
+ func syncAction (opType models.ActionType , repo * models.Repository , refName string , data []byte ) error {
17
17
if err := models .NotifyWatchers (& models.Action {
18
18
ActUserID : repo .OwnerID ,
19
19
ActUser : repo .MustOwner (),
@@ -34,16 +34,16 @@ func mirrorSyncAction(opType models.ActionType, repo *models.Repository, refName
34
34
return nil
35
35
}
36
36
37
- // MirrorSyncPushActionOptions mirror synchronization action options.
38
- type MirrorSyncPushActionOptions struct {
37
+ // SyncPushActionOptions mirror synchronization action options.
38
+ type SyncPushActionOptions struct {
39
39
RefName string
40
40
OldCommitID string
41
41
NewCommitID string
42
42
Commits * models.PushCommits
43
43
}
44
44
45
- // MirrorSyncPushAction adds new action for mirror synchronization of pushed commits.
46
- func MirrorSyncPushAction (repo * models.Repository , opts MirrorSyncPushActionOptions ) error {
45
+ // SyncPushAction adds new action for mirror synchronization of pushed commits.
46
+ func SyncPushAction (repo * models.Repository , opts SyncPushActionOptions ) error {
47
47
if len (opts .Commits .Commits ) > setting .UI .FeedMaxCommitNum {
48
48
opts .Commits .Commits = opts .Commits .Commits [:setting .UI .FeedMaxCommitNum ]
49
49
}
@@ -73,15 +73,15 @@ func MirrorSyncPushAction(repo *models.Repository, opts MirrorSyncPushActionOpti
73
73
return err
74
74
}
75
75
76
- return mirrorSyncAction (models .ActionMirrorSyncPush , repo , opts .RefName , data )
76
+ return syncAction (models .ActionMirrorSyncPush , repo , opts .RefName , data )
77
77
}
78
78
79
- // MirrorSyncCreateAction adds new action for mirror synchronization of new reference.
80
- func MirrorSyncCreateAction (repo * models.Repository , refName string ) error {
81
- return mirrorSyncAction (models .ActionMirrorSyncCreate , repo , refName , nil )
79
+ // SyncCreateAction adds new action for mirror synchronization of new reference.
80
+ func SyncCreateAction (repo * models.Repository , refName string ) error {
81
+ return syncAction (models .ActionMirrorSyncCreate , repo , refName , nil )
82
82
}
83
83
84
84
// MirrorSyncDeleteAction adds new action for mirror synchronization of delete reference.
85
- func MirrorSyncDeleteAction (repo * models.Repository , refName string ) error {
86
- return mirrorSyncAction (models .ActionMirrorSyncDelete , repo , refName , nil )
85
+ func SyncDeleteAction (repo * models.Repository , refName string ) error {
86
+ return syncAction (models .ActionMirrorSyncDelete , repo , refName , nil )
87
87
}
0 commit comments