diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-07-06 19:18:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 13:18:37 +0200 |
commit | 45ac90eb54d9f6b6877f68ebd0d84ebd12de170f (patch) | |
tree | 815bfc7e62560c2158564096b26acf5704c0d942 /services | |
parent | d17a848fe275c3e8734a4dfcaf2eae8ca0dc361c (diff) | |
download | gitea-45ac90eb54d9f6b6877f68ebd0d84ebd12de170f.tar.gz gitea-45ac90eb54d9f6b6877f68ebd0d84ebd12de170f.zip |
Sync branches when mirroring (#25722)
Caused by #22743
---------
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'services')
-rw-r--r-- | services/mirror/mirror_pull.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index 53ab632b01..51c7de58b6 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -307,6 +307,11 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo return nil, false } + log.Trace("SyncMirrors [repo: %-v]: syncing branches...", m.Repo) + if _, err = repo_module.SyncRepoBranchesWithRepo(ctx, m.Repo, gitRepo, 0); err != nil { + log.Error("SyncMirrors [repo: %-v]: failed to synchronize branches: %v", m.Repo, err) + } + log.Trace("SyncMirrors [repo: %-v]: syncing releases with tags...", m.Repo) if err = repo_module.SyncReleasesWithTags(m.Repo, gitRepo); err != nil { log.Error("SyncMirrors [repo: %-v]: failed to synchronize tags to releases: %v", m.Repo, err) |