Skip to content

Commit 45ac90e

Browse files
lunnyKN4CK3R
andauthored
Sync branches when mirroring (#25722)
Caused by #22743 --------- Co-authored-by: KN4CK3R <[email protected]>
1 parent d17a848 commit 45ac90e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/git/git.go

-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ func InitFull(ctx context.Context) (err error) {
188188
if CheckGitVersionAtLeast("2.9") == nil {
189189
globalCommandArgs = append(globalCommandArgs, "-c", "credential.helper=")
190190
}
191-
192191
SupportProcReceive = CheckGitVersionAtLeast("2.29") == nil
193192

194193
if setting.LFS.StartServer {

services/mirror/mirror_pull.go

+5
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
307307
return nil, false
308308
}
309309

310+
log.Trace("SyncMirrors [repo: %-v]: syncing branches...", m.Repo)
311+
if _, err = repo_module.SyncRepoBranchesWithRepo(ctx, m.Repo, gitRepo, 0); err != nil {
312+
log.Error("SyncMirrors [repo: %-v]: failed to synchronize branches: %v", m.Repo, err)
313+
}
314+
310315
log.Trace("SyncMirrors [repo: %-v]: syncing releases with tags...", m.Repo)
311316
if err = repo_module.SyncReleasesWithTags(m.Repo, gitRepo); err != nil {
312317
log.Error("SyncMirrors [repo: %-v]: failed to synchronize tags to releases: %v", m.Repo, err)

0 commit comments

Comments
 (0)