Skip to content

Commit

Permalink
Sync branches when mirroring (#25722)
Browse files Browse the repository at this point in the history
Caused by #22743

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
  • Loading branch information
lunny and KN4CK3R committed Jul 6, 2023
1 parent d17a848 commit 45ac90e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion modules/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func InitFull(ctx context.Context) (err error) {
if CheckGitVersionAtLeast("2.9") == nil {
globalCommandArgs = append(globalCommandArgs, "-c", "credential.helper=")
}

SupportProcReceive = CheckGitVersionAtLeast("2.29") == nil

if setting.LFS.StartServer {
Expand Down
5 changes: 5 additions & 0 deletions services/mirror/mirror_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 45ac90e

Please sign in to comment.