You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

repo_blob_gogit.go 485B

12345678910111213141516171819202122
  1. // Copyright 2018 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. //go:build gogit
  4. package git
  5. import (
  6. "github.com/go-git/go-git/v5/plumbing"
  7. )
  8. func (repo *Repository) getBlob(id ObjectID) (*Blob, error) {
  9. encodedObj, err := repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, plumbing.Hash(id.RawValue()))
  10. if err != nil {
  11. return nil, ErrNotExist{id.String(), ""}
  12. }
  13. return &Blob{
  14. ID: id,
  15. gogitEncodedObj: encodedObj,
  16. }, nil
  17. }