aboutsummaryrefslogtreecommitdiff
path: root/refstore/refstore.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-02-21 11:33:40 +0800
committerGravatar Runxi Yu2026-02-21 11:33:40 +0800
commit6cdf75c5a9e1f660aa2a86938be680c5db07ffd2 (patch)
treef16f22cc51930e97eaeb73e1e436d8a4c331fabf /refstore/refstore.go
parentrefstore/loose: Add loose refs implementation (diff)
signatureNo signature
refstore: Add ref shortening
Diffstat (limited to 'refstore/refstore.go')
-rw-r--r--refstore/refstore.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/refstore/refstore.go b/refstore/refstore.go
index a3c9f201..5653d4ca 100644
--- a/refstore/refstore.go
+++ b/refstore/refstore.go
@@ -29,6 +29,12 @@ type Store interface {
//
// The exact pattern language is backend-defined.
List(pattern string) ([]ref.Ref, error)
+ // Shorten returns the shortest unambiguous shorthand for a full
+ // reference name within this store's visible namespace.
+ //
+ // If name does not exist in this store, implementations should return
+ // ErrReferenceNotFound.
+ Shorten(name string) (string, error)
// Close releases resources associated with the store.
Close() error
}