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

Method ResolveExcerpt

cache/subcache.go:396–406  ·  view source on GitHub ↗

ResolveExcerpt retrieve an Excerpt matching the exact given id

(id entity.Id)

Source from the content-addressed store, hash-verified

394
395// ResolveExcerpt retrieve an Excerpt matching the exact given id
396func (sc *SubCache[EntityT, ExcerptT, CacheT]) ResolveExcerpt(id entity.Id) (ExcerptT, error) {
397 sc.mu.RLock()
398 defer sc.mu.RUnlock()
399
400 excerpt, ok := sc.excerpts[id]
401 if !ok {
402 return *new(ExcerptT), entity.NewErrNotFound(sc.typename)
403 }
404
405 return excerpt, nil
406}
407
408// ResolveExcerptPrefix retrieve an Excerpt matching an id prefix. It fails if multiple
409// entities match.

Callers 15

ResolveExcerptMatcherMethod · 0.95
TestCacheFunction · 0.80
LsFunction · 0.80
UserFunction · 0.80
UserForQueryFunction · 0.80
runUserFunction · 0.80
NewBugExcerptFunction · 0.80
runBugFunction · 0.80
bugsDefaultFormatterFunction · 0.80
bugsOrgmodeFormatterFunction · 0.80
bugWithBackendFunction · 0.80

Calls 1

NewErrNotFoundFunction · 0.92

Tested by 1

TestCacheFunction · 0.64