aboutsummaryrefslogtreecommitdiff
path: root/object/fetch/peel_to_tree_reader.go
blob: 260ba0da46f83c0e6f3963a13cd958d1ee59857a (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package fetch

import (
	"io"

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

// PeelToTreeReader returns a reader for the content of the peeled tree at id,
// together with its content size in bytes.
//
// Usage of this method is unusual.
//
// Labels: Life-Parent, Close-Caller.
func (r *Fetcher) PeelToTreeReader(id objectid.ObjectID) (io.ReadCloser, int64, error) {
	treeID, err := r.PeelToTreeID(id)
	if err != nil {
		return nil, 0, err
	}

	return r.ExactTreeReader(treeID)
}