diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-08-16 12:05:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 12:05:15 +0800 |
commit | 1f146090ecbd9876ed41ddccc4d05ee1bedbb48e (patch) | |
tree | 04a4f06ff8f9976f6dc8814a30585cc5b41247bf /models/git | |
parent | 86c85c19b625e6ddd99f220a13ee3b5c4cc398e1 (diff) | |
download | gitea-1f146090ecbd9876ed41ddccc4d05ee1bedbb48e.tar.gz gitea-1f146090ecbd9876ed41ddccc4d05ee1bedbb48e.zip |
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 <art27@cantab.net>
* Update cmd/migrate_storage.go
Co-authored-by: zeripath <art27@cantab.net>
* Update cmd/migrate_storage.go
Co-authored-by: zeripath <art27@cantab.net>
* Fix test
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/git')
-rw-r--r-- | models/git/lfs.go | 23 |
1 files changed, 0 insertions, 23 deletions
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 |