blob: 255abf39b65511e53ab0231881abfb459ed1ccda (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package commitgraph
import (
"os"
"codeberg.org/lindenii/furgit/internal/intconv"
"codeberg.org/lindenii/furgit/objectid"
)
func openSingle(root *os.Root, algo objectid.Algorithm) (*Reader, error) {
graph, err := openLayer(root, "info/commit-graph", algo)
if err != nil {
return nil, err
}
graph.baseCount = 0
graph.globalFrom = 0
hashVersion, err := intconv.Uint32ToUint8(algo.PackHashID())
if err != nil {
return nil, err
}
out := &Reader{
algo: algo,
hashVersion: hashVersion,
layers: []layer{*graph},
total: graph.numCommits,
}
return out, nil
}
|