From 161d2fab0b7ddee35696c5600d3ebd5bae6e6527 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 29 Mar 2026 08:09:34 +0000 Subject: repository: Add guidance --- repository/commit_graph.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'repository/commit_graph.go') diff --git a/repository/commit_graph.go b/repository/commit_graph.go index 3f0a0888..4f210b56 100644 --- a/repository/commit_graph.go +++ b/repository/commit_graph.go @@ -31,6 +31,11 @@ func openCommitGraph(root *os.Root, algo objectid.Algorithm) (*commitgraphread.R // CommitGraph returns the configured commit-graph reader, if available. // +// Not all repositories have a commit-graph, so CommitGraph may return nil. +// Most callers should prefer [Repository.CommitQueries] or +// [Repository.Reachability] unless they specifically need direct +// commit-graph access. +// // Labels: Life-Parent, Close-No. func (repo *Repository) CommitGraph() *commitgraphread.Reader { return repo.commitGraph -- cgit v1.3.1-10-gc9f91