From 1f146090ecbd9876ed41ddccc4d05ee1bedbb48e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 16 Aug 2022 12:05:15 +0800 Subject: Add migrate repo archiver and packages storage support on command line (#20757) * Add migrate repo archiver and packages storage support on command line * Fix typo * Use stdCtx * Use packageblob and fix command description * Add migrate packages unit tests * Fix comment year * Fix the migrate storage command line description * Update cmd/migrate_storage.go Co-authored-by: zeripath * Update cmd/migrate_storage.go Co-authored-by: zeripath * Update cmd/migrate_storage.go Co-authored-by: zeripath * Fix test Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath --- models/git/lfs.go | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'models/git') diff --git a/models/git/lfs.go b/models/git/lfs.go index ec963cf593..179da3120a 100644 --- a/models/git/lfs.go +++ b/models/git/lfs.go @@ -278,29 +278,6 @@ func LFSAutoAssociate(metas []*LFSMetaObject, user *user_model.User, repoID int6 return committer.Commit() } -// IterateLFS iterates lfs object -func IterateLFS(f func(mo *LFSMetaObject) error) error { - var start int - const batchSize = 100 - e := db.GetEngine(db.DefaultContext) - for { - mos := make([]*LFSMetaObject, 0, batchSize) - if err := e.Limit(batchSize, start).Find(&mos); err != nil { - return err - } - if len(mos) == 0 { - return nil - } - start += len(mos) - - for _, mo := range mos { - if err := f(mo); err != nil { - return err - } - } - } -} - // CopyLFS copies LFS data from one repo to another func CopyLFS(ctx context.Context, newRepo, oldRepo *repo_model.Repository) error { var lfsObjects []*LFSMetaObject -- cgit v1.2.3