mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 23:34:11 +02:00
Use standalone function to update repository cols (#34811)
Extract `UpdateRepository` Follow up #34762 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
750af1c981
commit
0771a79bf0
4 files changed
+31
-49
No files matched your search
@@ -41,11 +41,12 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("GetObjectFormat: %w", err)
|
||||
}
|
||||
_, err = db.GetEngine(ctx).ID(repo.ID).Update(&repo_model.Repository{ObjectFormatName: objFmt.Name()})
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("UpdateRepository: %w", err)
|
||||
if objFmt.Name() != repo.ObjectFormatName {
|
||||
repo.ObjectFormatName = objFmt.Name()
|
||||
if err = repo_model.UpdateRepositoryColsWithAutoTime(ctx, repo, "object_format_name"); err != nil {
|
||||
return 0, fmt.Errorf("UpdateRepositoryColsWithAutoTime: %w", err)
|
||||
}
|
||||
}
|
||||
repo.ObjectFormatName = objFmt.Name() // keep consistent with db
|
||||
|
||||
allBranches := container.Set[string]{}
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user