aboutsummaryrefslogtreecommitdiff
path: root/refstore/chain
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 14:46:42 +0800
committerGravatar Runxi Yu2026-03-07 15:56:34 +0800
commit9d8e9f07083e3e3c85f27bc0583258bce0266509 (patch)
treea638d20a6af7c728cfee5f4c2656fee78d3e992e /refstore/chain
parentrefstore/{loose,packed}: Delete (diff)
signatureNo signature
refstore: Remove Shorten for now
Diffstat (limited to 'refstore/chain')
-rw-r--r--refstore/chain/shorten.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/refstore/chain/shorten.go b/refstore/chain/shorten.go
deleted file mode 100644
index 9e755de4..00000000
--- a/refstore/chain/shorten.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package chain
-
-import "codeberg.org/lindenii/furgit/refstore"
-
-// Shorten shortens a full reference name using the chain-visible namespace.
-func (chain *Chain) Shorten(name string) (string, error) {
- refs, err := chain.List("")
- if err != nil {
- return "", err
- }
-
- names := make([]string, 0, len(refs))
- found := false
-
- for _, entry := range refs {
- if entry == nil {
- continue
- }
-
- full := entry.Name()
-
- names = append(names, full)
- if full == name {
- found = true
- }
- }
-
- if !found {
- return "", refstore.ErrReferenceNotFound
- }
-
- return refstore.ShortenName(name, names), nil
-}