aboutsummaryrefslogtreecommitdiff
path: root/repository/commit_graph.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 06:23:30 +0000
committerGravatar Runxi Yu2026-04-02 06:28:39 +0000
commita041d523de389b65b98a5373a8034041db2a8d83 (patch)
tree7b423dc735f463be616045f2c3c2095a7737aca7 /repository/commit_graph.go
parentresearch: Add dynamic pack resources (diff)
signatureNo signature
*: Remove
Diffstat (limited to 'repository/commit_graph.go')
-rw-r--r--repository/commit_graph.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/repository/commit_graph.go b/repository/commit_graph.go
deleted file mode 100644
index 4f210b56..00000000
--- a/repository/commit_graph.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package repository
-
-import (
- "errors"
- "os"
-
- commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
- objectid "codeberg.org/lindenii/furgit/object/id"
-)
-
-func openCommitGraph(root *os.Root, algo objectid.Algorithm) (*commitgraphread.Reader, error) {
- reader, err := commitgraphread.Open(root, algo, commitgraphread.OpenChain)
- if err == nil {
- return reader, nil
- }
-
- var malformed *commitgraphread.MalformedError
- if errors.As(err, &malformed) &&
- malformed.Path == "info/commit-graphs/commit-graph-chain" &&
- malformed.Reason == "missing commit-graph-chain" {
- reader, err = commitgraphread.Open(root, algo, commitgraphread.OpenSingle)
- if errors.Is(err, os.ErrNotExist) {
- return nil, nil //nolint:nilnil
- }
-
- return reader, err
- }
-
- return nil, err
-}
-
-// 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
-}