shithub: furgit

ref: 2a5c12f0152240f54d01653b70b7605103393afd
dir: /object/resolve/peel_to_commit_reader.go/

View raw version
package resolve

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

	return r.ExactCommitReader(commitID)
}