diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-09-08 23:45:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-08 23:45:10 +0800 |
commit | 7a5465fc56f79f5fc3c32547c89a80b7ebb24c8f (patch) | |
tree | c663ce5f0f37e13d950384fd76428c422adfb06d /modules/lfs/pointers.go | |
parent | e4b3f35b8d68d6409a280a8e644759e10b091cb1 (diff) | |
download | gitea-7a5465fc56f79f5fc3c32547c89a80b7ebb24c8f.tar.gz gitea-7a5465fc56f79f5fc3c32547c89a80b7ebb24c8f.zip |
LFS support to be stored on minio (#12518)
* LFS support to be stored on minio
* Fix test
* Fix lint
* Fix lint
* Fix check
* Fix test
* Update documents and add migration for LFS
* Fix some bugs
Diffstat (limited to 'modules/lfs/pointers.go')
-rw-r--r-- | modules/lfs/pointers.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/lfs/pointers.go b/modules/lfs/pointers.go index bc27ee37a7..c6fbf090e5 100644 --- a/modules/lfs/pointers.go +++ b/modules/lfs/pointers.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/storage" ) // ReadPointerFile will return a partially filled LFSMetaObject if the provided reader is a pointer file @@ -53,9 +54,10 @@ func IsPointerFile(buf *[]byte) *models.LFSMetaObject { return nil } - contentStore := &ContentStore{BasePath: setting.LFS.ContentPath} + contentStore := &ContentStore{ObjectStorage: storage.LFS} meta := &models.LFSMetaObject{Oid: oid, Size: size} - if !contentStore.Exists(meta) { + exist, err := contentStore.Exists(meta) + if err != nil || !exist { return nil } @@ -64,6 +66,6 @@ func IsPointerFile(buf *[]byte) *models.LFSMetaObject { // ReadMetaObject will read a models.LFSMetaObject and return a reader func ReadMetaObject(meta *models.LFSMetaObject) (io.ReadCloser, error) { - contentStore := &ContentStore{BasePath: setting.LFS.ContentPath} + contentStore := &ContentStore{ObjectStorage: storage.LFS} return contentStore.Get(meta, 0) } |