shithub: furgit

ref: a902f6849d938a51fa34dc292f5c81d26c4b6c36
dir: /object/fetch/peel_to_blob_reader.go/

View raw version
package fetch

import (
	"io"

	objectid "codeberg.org/lindenii/furgit/object/id"
)

// PeelToBlobReader returns a reader for the content of the peeled blob at id,
// together with its content size in bytes.
func (r *Fetcher) PeelToBlobReader(id objectid.ObjectID) (io.ReadCloser, int64, error) {
	blobID, err := r.PeelToBlobID(id)
	if err != nil {
		return nil, 0, err
	}

	return r.ExactBlobReader(blobID)
}