Skip to content

Commit 83ea5b1

Browse files
committed
fix lint
1 parent b3c3972 commit 83ea5b1

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

services/mirror/mirror.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -329,16 +329,16 @@ func SyncMirrors() {
329329

330330
// Create reference
331331
if result.oldCommitID == gitShortEmptySha {
332-
if err = MirrorSyncCreateAction(m.Repo, result.refName); err != nil {
333-
log.Error("MirrorSyncCreateAction [repo_id: %d]: %v", m.RepoID, err)
332+
if err = SyncCreateAction(m.Repo, result.refName); err != nil {
333+
log.Error("SyncCreateAction [repo_id: %d]: %v", m.RepoID, err)
334334
}
335335
continue
336336
}
337337

338338
// Delete reference
339339
if result.newCommitID == gitShortEmptySha {
340-
if err = MirrorSyncDeleteAction(m.Repo, result.refName); err != nil {
341-
log.Error("MirrorSyncDeleteAction [repo_id: %d]: %v", m.RepoID, err)
340+
if err = SyncDeleteAction(m.Repo, result.refName); err != nil {
341+
log.Error("SyncDeleteAction [repo_id: %d]: %v", m.RepoID, err)
342342
}
343343
continue
344344
}
@@ -359,13 +359,13 @@ func SyncMirrors() {
359359
log.Error("CommitsBetweenIDs [repo_id: %d, new_commit_id: %s, old_commit_id: %s]: %v", m.RepoID, newCommitID, oldCommitID, err)
360360
continue
361361
}
362-
if err = MirrorSyncPushAction(m.Repo, MirrorSyncPushActionOptions{
362+
if err = SyncPushAction(m.Repo, SyncPushActionOptions{
363363
RefName: result.refName,
364364
OldCommitID: oldCommitID,
365365
NewCommitID: newCommitID,
366366
Commits: models.ListToPushCommits(commits),
367367
}); err != nil {
368-
log.Error("MirrorSyncPushAction [repo_id: %d]: %v", m.RepoID, err)
368+
log.Error("SyncPushAction [repo_id: %d]: %v", m.RepoID, err)
369369
continue
370370
}
371371
}

services/mirror/sync.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
api "code.gitea.io/gitea/modules/structs"
1414
)
1515

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 {
1717
if err := models.NotifyWatchers(&models.Action{
1818
ActUserID: repo.OwnerID,
1919
ActUser: repo.MustOwner(),
@@ -34,16 +34,16 @@ func mirrorSyncAction(opType models.ActionType, repo *models.Repository, refName
3434
return nil
3535
}
3636

37-
// MirrorSyncPushActionOptions mirror synchronization action options.
38-
type MirrorSyncPushActionOptions struct {
37+
// SyncPushActionOptions mirror synchronization action options.
38+
type SyncPushActionOptions struct {
3939
RefName string
4040
OldCommitID string
4141
NewCommitID string
4242
Commits *models.PushCommits
4343
}
4444

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 {
4747
if len(opts.Commits.Commits) > setting.UI.FeedMaxCommitNum {
4848
opts.Commits.Commits = opts.Commits.Commits[:setting.UI.FeedMaxCommitNum]
4949
}
@@ -73,15 +73,15 @@ func MirrorSyncPushAction(repo *models.Repository, opts MirrorSyncPushActionOpti
7373
return err
7474
}
7575

76-
return mirrorSyncAction(models.ActionMirrorSyncPush, repo, opts.RefName, data)
76+
return syncAction(models.ActionMirrorSyncPush, repo, opts.RefName, data)
7777
}
7878

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)
8282
}
8383

8484
// 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)
8787
}

0 commit comments

Comments
 (0)