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

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.
func (r *Resolver) PeelToTreeReader(id objectid.ObjectID) (io.ReadCloser, int64, error) {
	treeID, err := r.PeelToTreeID(id)
	if err != nil {
		return nil, 0, err
	}

	return r.ExactTreeReader(treeID)
}