summaryrefslogtreecommitdiffstats
path: root/routers/repo/lfs.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-09-08 23:45:10 +0800
committerGitHub <noreply@github.com>2020-09-08 23:45:10 +0800
commit7a5465fc56f79f5fc3c32547c89a80b7ebb24c8f (patch)
treec663ce5f0f37e13d950384fd76428c422adfb06d /routers/repo/lfs.go
parente4b3f35b8d68d6409a280a8e644759e10b091cb1 (diff)
downloadgitea-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 'routers/repo/lfs.go')
-rw-r--r--routers/repo/lfs.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/routers/repo/lfs.go b/routers/repo/lfs.go
index 4caf01adfd..481a3e57ad 100644
--- a/routers/repo/lfs.go
+++ b/routers/repo/lfs.go
@@ -28,6 +28,7 @@ import (
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/util"
gogit "github.com/go-git/go-git/v5"
@@ -619,7 +620,7 @@ type pointerResult struct {
func createPointerResultsFromCatFileBatch(catFileBatchReader *io.PipeReader, wg *sync.WaitGroup, pointerChan chan<- pointerResult, repo *models.Repository, user *models.User) {
defer wg.Done()
defer catFileBatchReader.Close()
- contentStore := lfs.ContentStore{BasePath: setting.LFS.ContentPath}
+ contentStore := lfs.ContentStore{ObjectStorage: storage.LFS}
bufferedReader := bufio.NewReader(catFileBatchReader)
buf := make([]byte, 1025)
@@ -673,7 +674,11 @@ func createPointerResultsFromCatFileBatch(catFileBatchReader *io.PipeReader, wg
result.InRepo = true
}
- result.Exists = contentStore.Exists(pointer)
+ result.Exists, err = contentStore.Exists(pointer)
+ if err != nil {
+ _ = catFileBatchReader.CloseWithError(err)
+ break
+ }
if result.Exists {
if !result.InRepo {