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

Method ResolveExcerptPrefix

cache/subcache.go:410–414  ·  view source on GitHub ↗

ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple entities match.

(prefix string)

Source from the content-addressed store, hash-verified

408// ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple
409// entities match.
410func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerptPrefix(prefix string) (ExcerptT, error) {
411 return sc.ResolveExcerptMatcher(func(excerpt ExcerptT) bool {
412 return excerpt.Id().HasPrefix(prefix)
413 })
414}
415
416func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerptMatcher(f func(ExcerptT) bool) (ExcerptT, error) {
417 id, err := sc.resolveMatcher(f)

Callers 2

BugMethod · 0.80
IdentityMethod · 0.80

Calls 3

ResolveExcerptMatcherMethod · 0.95
IdMethod · 0.65
HasPrefixMethod · 0.45

Tested by

no test coverage detected