mirror of
https://github.com/go-gitea/gitea
synced 2024-11-05 09:44:26 +00:00
e81ccc406b
Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
23 lines
455 B
Go
23 lines
455 B
Go
// Copyright 2018 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//go:build gogit
|
|
|
|
package git
|
|
|
|
import (
|
|
"github.com/go-git/go-git/v5/plumbing"
|
|
)
|
|
|
|
func (repo *Repository) getBlob(id SHA1) (*Blob, error) {
|
|
encodedObj, err := repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, id)
|
|
if err != nil {
|
|
return nil, ErrNotExist{id.String(), ""}
|
|
}
|
|
|
|
return &Blob{
|
|
ID: id,
|
|
gogitEncodedObj: encodedObj,
|
|
}, nil
|
|
}
|