MCPcopy Index your code
hub / github.com/git-bug/git-bug / ResolvePrefix

Method ResolvePrefix

cache/subcache.go:381–385  ·  view source on GitHub ↗

ResolvePrefix retrieve an entity matching an id prefix. It fails if multiple entities match.

(prefix string)

Source from the content-addressed store, hash-verified

379// ResolvePrefix retrieve an entity matching an id prefix. It fails if multiple
380// entities match.
381func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolvePrefix(prefix string) (CacheT, error) {
382 return sc.ResolveMatcher(func(excerpt ExcerptT) bool {
383 return excerpt.Id().HasPrefix(prefix)
384 })
385}
386
387func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveMatcher(f func(ExcerptT) bool) (CacheT, error) {
388 id, err := sc.resolveMatcher(f)

Callers 1

RemoveMethod · 0.95

Calls 3

ResolveMatcherMethod · 0.95
IdMethod · 0.65
HasPrefixMethod · 0.45

Tested by

no test coverage detected