aboutsummaryrefslogtreecommitdiff
path: root/object/fetch/peel_to_commit_reader.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 19:33:32 +0000
committerGravatar Runxi Yu2026-03-25 19:33:57 +0000
commit1aa5cad4c8d6455eeb1f10893549e18bcca11996 (patch)
tree31082a30bde08639fc764c52c3cf2283489f3302 /object/fetch/peel_to_commit_reader.go
parentTODO: updates (diff)
signatureNo signature
object/fetch: Rename from object/resolve
Diffstat (limited to 'object/fetch/peel_to_commit_reader.go')
-rw-r--r--object/fetch/peel_to_commit_reader.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/object/fetch/peel_to_commit_reader.go b/object/fetch/peel_to_commit_reader.go
new file mode 100644
index 00000000..02bf9f6f
--- /dev/null
+++ b/object/fetch/peel_to_commit_reader.go
@@ -0,0 +1,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)
+}