aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-28 18:19:19 +0000
committerGravatar Runxi Yu2026-03-28 18:19:19 +0000
commite179938136297be60d3e6e08c9f877b08e5180df (patch)
tree666b33d3d3e79dbb81224ed52b0df3b8675afa37
parentnetwork/receivepack: Update docs (diff)
signatureNo signature
reachability, repository: MT-Safe reachability v0.1.125
-rw-r--r--reachability/reachability.go2
-rw-r--r--repository/reachability.go11
-rw-r--r--repository/repository.go5
3 files changed, 15 insertions, 3 deletions
diff --git a/reachability/reachability.go b/reachability/reachability.go
index 6932016b..2266243c 100644
--- a/reachability/reachability.go
+++ b/reachability/reachability.go
@@ -8,7 +8,7 @@ import (
// Reachability provides graph traversal over objects in one object store.
//
-// Labels: MT-Unsafe.
+// Labels: MT-Safe.
type Reachability struct {
store objectstore.ReadingStore
graph *commitgraphread.Reader
diff --git a/repository/reachability.go b/repository/reachability.go
new file mode 100644
index 00000000..4e6a4559
--- /dev/null
+++ b/repository/reachability.go
@@ -0,0 +1,11 @@
+package repository
+
+import "codeberg.org/lindenii/furgit/reachability"
+
+// Reachability returns graph traversal helpers backed by the repository's
+// object store and optional commit-graph.
+//
+// Labels: Life-Parent, Close-No.
+func (repo *Repository) Reachability() *reachability.Reachability {
+ return reachability.New(repo.objects, repo.commitGraph)
+}
diff --git a/repository/repository.go b/repository/repository.go
index cad9ceed..119f8c42 100644
--- a/repository/repository.go
+++ b/repository/repository.go
@@ -21,8 +21,9 @@ import (
// a bare repository root or a non-bare ".git" directory.
//
// Accessors such as [Repository.Objects], [Repository.CommitGraph],
-// [Repository.CommitQueries], [Repository.Refs], [Repository.Fetcher],
-// and [Repository.LooseStoreForWriting] return repository-backed views.
+// [Repository.CommitQueries], [Repository.Reachability], [Repository.Refs],
+// [Repository.Fetcher], and [Repository.LooseStoreForWriting] return
+// repository-backed views.
//
// Labels: MT-Safe, Close-Caller.
type Repository struct {