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