aboutsummaryrefslogtreecommitdiff
path: root/refstore/packed/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'refstore/packed/list.go')
-rw-r--r--refstore/packed/list.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/refstore/packed/list.go b/refstore/packed/list.go
deleted file mode 100644
index 422c1026..00000000
--- a/refstore/packed/list.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package packed
-
-import (
- "path"
-
- "codeberg.org/lindenii/furgit/ref"
-)
-
-// List lists packed references matching pattern.
-//
-// Pattern uses path.Match syntax against full reference names.
-// Empty pattern matches all references.
-func (store *Store) List(pattern string) ([]ref.Ref, error) {
- matchAll := pattern == ""
- if !matchAll {
- _, err := path.Match(pattern, "refs/heads/main")
- if err != nil {
- return nil, err
- }
- }
-
- refs := make([]ref.Ref, 0, len(store.ordered))
- for _, entry := range store.ordered {
- if !matchAll {
- matched, err := path.Match(pattern, entry.Name())
- if err != nil {
- return nil, err
- }
-
- if !matched {
- continue
- }
- }
-
- refs = append(refs, entry)
- }
-
- return refs, nil
-}