aboutsummaryrefslogtreecommitdiff
path: root/format/commitgraph/read/reader.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-26 09:17:14 +0000
committerGravatar Runxi Yu2026-03-26 09:18:30 +0000
commit3e884f5f3d42cbc4874a04da31dde10314b0cfad (patch)
treef5e1e325fd1a2a0801791c054010213214475d80 /format/commitgraph/read/reader.go
parentnetwork/receivepack: Rename from receivepack (diff)
signatureNo signature
format: Move commitgraph and packfile here
Diffstat (limited to 'format/commitgraph/read/reader.go')
-rw-r--r--format/commitgraph/read/reader.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/format/commitgraph/read/reader.go b/format/commitgraph/read/reader.go
new file mode 100644
index 00000000..d5c84a70
--- /dev/null
+++ b/format/commitgraph/read/reader.go
@@ -0,0 +1,16 @@
+package read
+
+import objectid "codeberg.org/lindenii/furgit/object/id"
+
+// Reader provides read-only access to one mmap-backed commit-graph snapshot.
+//
+// It is safe for concurrent read-only queries.
+// Values returned by Reader methods are only valid until the reader is closed
+// when explicitly documented on that method.
+type Reader struct {
+ algo objectid.Algorithm
+ hashVersion uint8
+
+ layers []layer
+ total uint32
+}