aboutsummaryrefslogtreecommitdiff
path: root/refstore/chain/list.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 14:31:16 +0000
committerGravatar Runxi Yu2026-03-25 14:31:16 +0000
commit48ff647cf4a8bb8f23fcd6b8616f56a8ef72b980 (patch)
treeae199c38042adaa544d5f7d31351661d5831381e /refstore/chain/list.go
parent*: objectstore -> object/store (diff)
signatureNo signature
*: refstore -> ref/store
Diffstat (limited to 'refstore/chain/list.go')
-rw-r--r--refstore/chain/list.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/refstore/chain/list.go b/refstore/chain/list.go
deleted file mode 100644
index c577ca85..00000000
--- a/refstore/chain/list.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package chain
-
-import (
- "fmt"
-
- "codeberg.org/lindenii/furgit/ref"
-)
-
-// List lists references from every backend and deduplicates by ref name.
-//
-// First-seen wins, so earlier backends have precedence.
-func (chain *Chain) List(pattern string) ([]ref.Ref, error) {
- var refs []ref.Ref
-
- seen := map[string]struct{}{}
-
- for i, backend := range chain.backends {
- listed, err := backend.List(pattern)
- if err != nil {
- return nil, fmt.Errorf("refstore: backend %d list: %w", i, err)
- }
-
- for _, entry := range listed {
- if entry == nil {
- continue
- }
-
- name := entry.Name()
- if _, ok := seen[name]; ok {
- continue
- }
-
- seen[name] = struct{}{}
-
- refs = append(refs, entry)
- }
- }
-
- return refs, nil
-}