aboutsummaryrefslogtreecommitdiff
path: root/commitgraph/read/edges.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 /commitgraph/read/edges.go
parentnetwork/receivepack: Rename from receivepack (diff)
signatureNo signature
format: Move commitgraph and packfile here
Diffstat (limited to 'commitgraph/read/edges.go')
-rw-r--r--commitgraph/read/edges.go48
1 files changed, 0 insertions, 48 deletions
diff --git a/commitgraph/read/edges.go b/commitgraph/read/edges.go
deleted file mode 100644
index 33a6c9fc..00000000
--- a/commitgraph/read/edges.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package read
-
-import (
- "encoding/binary"
-
- "codeberg.org/lindenii/furgit/commitgraph"
- "codeberg.org/lindenii/furgit/internal/intconv"
-)
-
-func (reader *Reader) decodeExtraEdgeList(layer *layer, edgeStart uint32) ([]Position, error) {
- if len(layer.chunkExtraEdges) == 0 {
- return nil, &MalformedError{Path: layer.path, Reason: "missing EDGE chunk"}
- }
-
- out := make([]Position, 0)
-
- cur := edgeStart
- for {
- off64 := uint64(cur) * 4
-
- off, err := intconv.Uint64ToInt(off64)
- if err != nil {
- return nil, err
- }
-
- if off+4 > len(layer.chunkExtraEdges) {
- return nil, &MalformedError{Path: layer.path, Reason: "EDGE index out of range"}
- }
-
- word := binary.BigEndian.Uint32(layer.chunkExtraEdges[off : off+4])
- parentGlobal := word & commitgraph.ParentLastMask
-
- parentPos, err := reader.globalToPosition(parentGlobal)
- if err != nil {
- return nil, err
- }
-
- out = append(out, parentPos)
-
- if word&commitgraph.ParentExtraMask != 0 {
- break
- }
-
- cur++
- }
-
- return out, nil
-}