1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

Make "sync branch" also sync object format and add tests (#30878) (#30880)

Backport #30878 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit ad5a8d043c6818c0c496ebae2f5ea9373219bcd6)
This commit is contained in:
Giteabot 2024-05-07 08:33:28 +08:00 committed by Earl Warren
parent 1582b1e83a
commit 220594bacc
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
4 changed files with 45 additions and 27 deletions

View file

@ -195,6 +195,10 @@ func adoptRepository(ctx context.Context, repoPath string, u *user_model.User, r
}
defer gitRepo.Close()
if _, err = repo_module.SyncRepoBranchesWithRepo(ctx, repo, gitRepo, 0); err != nil {
return fmt.Errorf("SyncRepoBranches: %w", err)
}
if err = repo_module.SyncReleasesWithTags(ctx, repo, gitRepo); err != nil {
return fmt.Errorf("SyncReleasesWithTags: %w", err)
}