1// Copyright 2018 The Gitea Authors. All rights reserved. 2// Use of this source code is governed by a MIT-style 3// license that can be found in the LICENSE file. 4 5//go:build gogit 6// +build gogit 7 8package git 9 10import ( 11 "github.com/go-git/go-git/v5/plumbing" 12) 13 14func (repo *Repository) getBlob(id SHA1) (*Blob, error) { 15 encodedObj, err := repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, id) 16 if err != nil { 17 return nil, ErrNotExist{id.String(), ""} 18 } 19 20 return &Blob{ 21 ID: id, 22 gogitEncodedObj: encodedObj, 23 }, nil 24} 25