aboutsummaryrefslogtreecommitdiff
path: root/repository
diff options
context:
space:
mode:
Diffstat (limited to 'repository')
-rw-r--r--repository/reachability.go11
-rw-r--r--repository/repository.go5
2 files changed, 14 insertions, 2 deletions
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 {