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 526B

1234567891011121314151617181920212223
  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. // +build gogit
  5. package git
  6. import (
  7. "github.com/go-git/go-git/v5/plumbing"
  8. )
  9. func (repo *Repository) getBlob(id SHA1) (*Blob, error) {
  10. encodedObj, err := repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, id)
  11. if err != nil {
  12. return nil, ErrNotExist{id.String(), ""}
  13. }
  14. return &Blob{
  15. ID: id,
  16. gogitEncodedObj: encodedObj,
  17. }, nil
  18. }