diff options
| author | 2026-04-02 06:23:30 +0000 | |
|---|---|---|
| committer | 2026-04-02 06:28:39 +0000 | |
| commit | a041d523de389b65b98a5373a8034041db2a8d83 (patch) | |
| tree | 7b423dc735f463be616045f2c3c2095a7737aca7 /format/commitgraph/read/position.go | |
| parent | research: Add dynamic pack resources (diff) | |
| signature | No signature | |
*: Remove
Diffstat (limited to 'format/commitgraph/read/position.go')
| -rw-r--r-- | format/commitgraph/read/position.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/format/commitgraph/read/position.go b/format/commitgraph/read/position.go deleted file mode 100644 index b2e1138b..00000000 --- a/format/commitgraph/read/position.go +++ /dev/null @@ -1,38 +0,0 @@ -package read - -import ( - "fmt" - - "codeberg.org/lindenii/furgit/internal/intconv" -) - -// Position identifies one commit record by layer and row index. -type Position struct { - Graph uint32 - Index uint32 -} - -func (reader *Reader) globalToPosition(global uint32) (Position, error) { - for i := range reader.layers { - layer := &reader.layers[i] - from := layer.globalFrom - - to := from + layer.numCommits - if global >= from && global < to { - graph, err := intconv.IntToUint32(i) - if err != nil { - return Position{}, err - } - - return Position{ - Graph: graph, - Index: global - from, - }, nil - } - } - - return Position{}, &MalformedError{ - Path: "commit-graph", - Reason: fmt.Sprintf("parent global position out of range: %d", global), - } -} |
