aboutsummaryrefslogtreecommitdiff
path: root/object/fetch/peel_to_blob_reader.go
blob: d7072531417de2daf9bf3af329811e9c0c8b78a6 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}