aboutsummaryrefslogtreecommitdiff
path: root/object/fetch/peel_to_commit_reader.go
blob: 3b4cf82490a35135b7006cbd959f83fe689f12f9 (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"
)

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

	return r.ExactCommitReader(commitID)
}