diff options
Diffstat (limited to 'services/pull/lfs.go')
-rw-r--r-- | services/pull/lfs.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/pull/lfs.go b/services/pull/lfs.go index 4b9826bedd..dc4ca006e4 100644 --- a/services/pull/lfs.go +++ b/services/pull/lfs.go @@ -11,6 +11,7 @@ import ( "strconv" "sync" + "code.gitea.io/gitea/models/db" git_model "code.gitea.io/gitea/models/git" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/modules/git/pipeline" @@ -115,7 +116,7 @@ func createLFSMetaObjectsFromCatFileBatch(catFileBatchReader *io.PipeReader, wg } // Then we need to check that this pointer is in the db - if _, err := git_model.GetLFSMetaObjectByOid(pr.HeadRepo.ID, pointer.Oid); err != nil { + if _, err := git_model.GetLFSMetaObjectByOid(db.DefaultContext, pr.HeadRepo.ID, pointer.Oid); err != nil { if err == git_model.ErrLFSObjectNotExist { log.Warn("During merge of: %d in %-v, there is a pointer to LFS Oid: %s which although present in the LFS store is not associated with the head repo %-v", pr.Index, pr.BaseRepo, pointer.Oid, pr.HeadRepo) continue @@ -128,7 +129,7 @@ func createLFSMetaObjectsFromCatFileBatch(catFileBatchReader *io.PipeReader, wg // Therefore it should be associated with the base repo meta := &git_model.LFSMetaObject{Pointer: pointer} meta.RepositoryID = pr.BaseRepoID - if _, err := git_model.NewLFSMetaObject(meta); err != nil { + if _, err := git_model.NewLFSMetaObject(db.DefaultContext, meta); err != nil { _ = catFileBatchReader.CloseWithError(err) break } |