diff options
| author | 2026-03-06 11:54:21 +0800 | |
|---|---|---|
| committer | 2026-03-06 11:55:56 +0800 | |
| commit | c62c5544fa23378843a3383a9dcd4494e5ea33bc (patch) | |
| tree | 8b825a36767fe0ba3fb44f27cb634047c4c0318f /format/commitgraph/oidat.go | |
| parent | format/pack/ingest: Fix delta apply import (diff) | |
| signature | No signature | |
format/commitgraph: Split into ./read and ./ v0.1.60
Diffstat (limited to 'format/commitgraph/oidat.go')
| -rw-r--r-- | format/commitgraph/oidat.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/format/commitgraph/oidat.go b/format/commitgraph/oidat.go deleted file mode 100644 index e277125b..00000000 --- a/format/commitgraph/oidat.go +++ /dev/null @@ -1,36 +0,0 @@ -package commitgraph - -import ( - "codeberg.org/lindenii/furgit/internal/intconv" - "codeberg.org/lindenii/furgit/objectid" -) - -// OIDAt returns object ID at one position. -func (reader *Reader) OIDAt(pos Position) (objectid.ObjectID, error) { - layer, err := reader.layerByPosition(pos) - if err != nil { - return objectid.ObjectID{}, err - } - - hashSize := reader.algo.Size() - - hashSizeU64, err := intconv.IntToUint64(hashSize) - if err != nil { - return objectid.ObjectID{}, err - } - - start64 := uint64(pos.Index) * hashSizeU64 - end64 := start64 + hashSizeU64 - - start, err := intconv.Uint64ToInt(start64) - if err != nil { - return objectid.ObjectID{}, err - } - - end, err := intconv.Uint64ToInt(end64) - if err != nil { - return objectid.ObjectID{}, err - } - - return objectid.FromBytes(reader.algo, layer.chunkOIDLookup[start:end]) -} |
