diff options
| author | 2026-03-07 14:52:58 +0800 | |
|---|---|---|
| committer | 2026-03-07 15:56:29 +0800 | |
| commit | c4710f2f9b4f88d2e5c633dd96afea42ee732cec (patch) | |
| tree | 564e1cbb87c9fb9245e1586afb36ef32edfbe0cc /refstore/packed/list.go | |
| parent | refstore: Add TransactionalStore (diff) | |
| signature | No signature | |
refstore/{loose,packed}: Delete
Diffstat (limited to 'refstore/packed/list.go')
| -rw-r--r-- | refstore/packed/list.go | 39 |
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 -} |
