···31313232// CommitGraph returns the configured commit-graph reader, if available.
3333//
3434+// Not all repositories have a commit-graph, so CommitGraph may return nil.
3535+// Most callers should prefer [Repository.CommitQueries] or
3636+// [Repository.Reachability] unless they specifically need direct
3737+// commit-graph access.
3838+//
3439// Labels: Life-Parent, Close-No.
3540func (repo *Repository) CommitGraph() *commitgraphread.Reader {
3641 return repo.commitGraph
+2
repository/commit_queries.go
···55// CommitQueries returns commit queries backed by the repository's object store
66// and optional commit-graph.
77//
88+// Use CommitQueries for ancestor checks and merge-base computation.
99+//
810// Labels: Life-Parent, Close-No.
911func (repo *Repository) CommitQueries() *commitquery.Queries {
1012 return repo.commitQueries
+4
repository/fetcher.go
···4455// Fetcher returns an object fetcher backed by the repository's object store.
66//
77+// Use Fetcher when you want typed commits, trees, blobs, or tags, when you
88+// need to peel through annotated tags, or when you want path-based access
99+// within trees.
1010+//
711// Labels: Life-Parent, Close-No.
812func (repo *Repository) Fetcher() *fetch.Fetcher {
913 return fetch.New(repo.objects)
+4
repository/objects.go
···77777878// Objects returns the configured object store.
7979//
8080+// Use Objects for direct object-ID lookups, object headers, sizes, raw object
8181+// bytes, or streamed object contents. Callers who want typed object values
8282+// should usually prefer [Repository.Fetcher].
8383+//
8084// Labels: Life-Parent, Close-No.
8185//
8286//nolint:ireturn
+5-1
repository/open.go
···88 reffiles "codeberg.org/lindenii/furgit/ref/store/files"
99)
10101111-// Open opens a repository and wires object/ref stores from its on-disk format.
1111+// Open opens a repository and wires its stores and helpers from the on-disk
1212+// repository format.
1313+//
1414+// root must refer to the Git directory itself:
1515+// a bare repository root or a non-bare ".git" directory.
1216//
1317// Labels: Deps-Borrowed.
1418func Open(root *os.Root) (repo *Repository, err error) {
+3
repository/reachability.go
···55// Reachability returns graph traversal helpers backed by the repository's
66// object store and optional commit-graph.
77//
88+// Use Reachability to walk reachable commits or objects and to perform
99+// connectivity checks.
1010+//
811// Labels: Life-Parent, Close-No.
912func (repo *Repository) Reachability() *reachability.Reachability {
1013 return reachability.New(repo.objects, repo.commitGraph)
+4
repository/refs.go
···4455// Refs returns the configured ref store.
66//
77+// Use Refs when starting from branch names, tags, HEAD, or other references.
88+// A common pattern is to resolve a reference first and then pass the resulting
99+// object ID to [Repository.Fetcher] or [Repository.Objects].
1010+//
711// Labels: Life-Parent, Close-No.
812//
913//nolint:ireturn
+9-8
repository/repository.go
···11-// Package repository opens stores and other objects to access a typical on-disk repo.
11+// Package repository opens a typical on-disk Git repository and exposes its
22+// main stores and helpers.
33+//
44+// Start with [Open] when working with a bare repository root or a non-bare
55+// ".git" directory. [Repository] then provides access to ref storage, object
66+// storage, typed object fetching, commit queries, reachability helpers, and
77+// optional commit-graph access.
28package repository
39410import (
···1420 refstore "codeberg.org/lindenii/furgit/ref/store"
1521)
16221717-// Repository represents a typical on-disk Git repository by composing
1818-// its stores together for access.
2323+// Repository represents a typical on-disk Git repository by composing its
2424+// stores and helpers together for access.
1925//
2026// Open expects a root for the Git directory itself:
2127// a bare repository root or a non-bare ".git" directory.
2222-//
2323-// Accessors such as [Repository.Objects], [Repository.CommitGraph],
2424-// [Repository.CommitQueries], [Repository.Reachability], [Repository.Refs],
2525-// [Repository.Fetcher], and [Repository.LooseStoreForWriting] return
2626-// repository-backed views.
2728//
2829// Labels: MT-Safe, Close-Caller.
2930type Repository struct {