aboutsummaryrefslogtreecommitdiff
path: root/commitgraph/read/generation.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/generation.go
parentnetwork/receivepack: Rename from receivepack (diff)
signatureNo signature
format: Move commitgraph and packfile here
Diffstat (limited to 'commitgraph/read/generation.go')
-rw-r--r--commitgraph/read/generation.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/commitgraph/read/generation.go b/commitgraph/read/generation.go
deleted file mode 100644
index 53dabe2d..00000000
--- a/commitgraph/read/generation.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package read
-
-import (
- "encoding/binary"
-
- "codeberg.org/lindenii/furgit/commitgraph"
- "codeberg.org/lindenii/furgit/internal/intconv"
-)
-
-func (reader *Reader) readGenerationV2(layer *layer, index uint32, commitTime uint64) (uint64, error) {
- if len(layer.chunkGeneration) == 0 {
- return 0, nil
- }
-
- off64 := uint64(index) * 4
-
- off, err := intconv.Uint64ToInt(off64)
- if err != nil {
- return 0, err
- }
-
- value := binary.BigEndian.Uint32(layer.chunkGeneration[off : off+4])
-
- if value&commitgraph.GenerationOverflow == 0 {
- return commitTime + uint64(value), nil
- }
-
- gdo2Index := value ^ commitgraph.GenerationOverflow
- gdo2Off64 := uint64(gdo2Index) * 8
-
- gdo2Off, err := intconv.Uint64ToInt(gdo2Off64)
- if err != nil {
- return 0, err
- }
-
- if gdo2Off+8 > len(layer.chunkGenerationOv) {
- return 0, &MalformedError{Path: layer.path, Reason: "GDO2 index out of range"}
- }
-
- overflow := binary.BigEndian.Uint64(layer.chunkGenerationOv[gdo2Off : gdo2Off+8])
-
- return commitTime + overflow, nil
-}