aboutsummaryrefslogtreecommitdiff
path: root/reachability
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 11:54:21 +0800
committerGravatar Runxi Yu2026-03-06 11:55:56 +0800
commitc62c5544fa23378843a3383a9dcd4494e5ea33bc (patch)
tree8b825a36767fe0ba3fb44f27cb634047c4c0318f /reachability
parentformat/pack/ingest: Fix delta apply import (diff)
signatureNo signature
format/commitgraph: Split into ./read and ./ v0.1.60
Diffstat (limited to 'reachability')
-rw-r--r--reachability/ancestor.go10
-rw-r--r--reachability/reachability.go6
-rw-r--r--reachability/walk_expand_commits_graph.go4
3 files changed, 10 insertions, 10 deletions
diff --git a/reachability/ancestor.go b/reachability/ancestor.go
index 5c978bf4..98a2c080 100644
--- a/reachability/ancestor.go
+++ b/reachability/ancestor.go
@@ -3,7 +3,7 @@ package reachability
import (
"errors"
- "codeberg.org/lindenii/furgit/format/commitgraph"
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
"codeberg.org/lindenii/furgit/objectid"
)
@@ -57,7 +57,7 @@ func (r *Reachability) isAncestorGraph(ancestor, descendant objectid.ObjectID) (
ancestorPos, err := r.graph.Lookup(ancestor)
if err != nil {
- var notFound *commitgraph.ErrNotFound
+ var notFound *commitgraphread.ErrNotFound
if errors.As(err, &notFound) {
return false, false, nil
}
@@ -67,7 +67,7 @@ func (r *Reachability) isAncestorGraph(ancestor, descendant objectid.ObjectID) (
descendantPos, err := r.graph.Lookup(descendant)
if err != nil {
- var notFound *commitgraph.ErrNotFound
+ var notFound *commitgraphread.ErrNotFound
if errors.As(err, &notFound) {
return false, false, nil
}
@@ -81,8 +81,8 @@ func (r *Reachability) isAncestorGraph(ancestor, descendant objectid.ObjectID) (
}
ancestorGeneration := ancestorCommit.GenerationV2
- stack := []commitgraph.Position{descendantPos}
- visited := make(map[commitgraph.Position]struct{}, 64)
+ stack := []commitgraphread.Position{descendantPos}
+ visited := make(map[commitgraphread.Position]struct{}, 64)
for len(stack) > 0 {
pos := stack[len(stack)-1]
diff --git a/reachability/reachability.go b/reachability/reachability.go
index 1180e32a..f9dab764 100644
--- a/reachability/reachability.go
+++ b/reachability/reachability.go
@@ -2,7 +2,7 @@
package reachability
import (
- "codeberg.org/lindenii/furgit/format/commitgraph"
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
"codeberg.org/lindenii/furgit/objectstore"
)
@@ -11,7 +11,7 @@ import (
// It is not safe for concurrent use.
type Reachability struct {
store objectstore.Store
- graph *commitgraph.Reader
+ graph *commitgraphread.Reader
}
// New builds a Reachability over one object store.
@@ -21,6 +21,6 @@ func New(store objectstore.Store) *Reachability {
// NewWithCommitGraph builds a Reachability over one object store with an
// optional commit-graph reader for faster commit-domain traversal.
-func NewWithCommitGraph(store objectstore.Store, graph *commitgraph.Reader) *Reachability {
+func NewWithCommitGraph(store objectstore.Store, graph *commitgraphread.Reader) *Reachability {
return &Reachability{store: store, graph: graph}
}
diff --git a/reachability/walk_expand_commits_graph.go b/reachability/walk_expand_commits_graph.go
index 15780c8e..bbdc0ade 100644
--- a/reachability/walk_expand_commits_graph.go
+++ b/reachability/walk_expand_commits_graph.go
@@ -3,7 +3,7 @@ package reachability
import (
"errors"
- "codeberg.org/lindenii/furgit/format/commitgraph"
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
"codeberg.org/lindenii/furgit/objectid"
"codeberg.org/lindenii/furgit/objecttype"
)
@@ -11,7 +11,7 @@ import (
func (walk *Walk) expandCommitsFromGraph(id objectid.ObjectID) ([]walkItem, bool, error) {
pos, err := walk.reachability.graph.Lookup(id)
if err != nil {
- var notFound *commitgraph.ErrNotFound
+ var notFound *commitgraphread.ErrNotFound
if errors.As(err, &notFound) {
return nil, false, nil
}