From 7a5465fc56f79f5fc3c32547c89a80b7ebb24c8f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 8 Sep 2020 23:45:10 +0800 Subject: 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 --- routers/repo/lfs.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'routers/repo/lfs.go') 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 { -- cgit v1.2.3