diff options
| -rw-r--r-- | reachability/reachability.go | 2 | ||||
| -rw-r--r-- | repository/reachability.go | 11 | ||||
| -rw-r--r-- | repository/repository.go | 5 |
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 { |
