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

Method RemoveAll

cache/subcache.go:504–534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

502}
503
504func (sc *SubCache[EntityT, ExcerptT, CacheT]) RemoveAll() error {
505 sc.mu.Lock()
506
507 err := sc.actions.RemoveAll(sc.repo)
508 if err != nil {
509 sc.mu.Unlock()
510 return err
511 }
512
513 for id, _ := range sc.cached {
514 delete(sc.cached, id)
515 sc.lru.Remove(id)
516 }
517 for id, _ := range sc.excerpts {
518 delete(sc.excerpts, id)
519 }
520
521 index, err := sc.repo.GetIndex(sc.namespace)
522 if err != nil {
523 sc.mu.Unlock()
524 return err
525 }
526
527 err = index.Clear()
528 sc.mu.Unlock()
529 if err != nil {
530 return err
531 }
532
533 return sc.write()
534}
535
536func (sc *SubCache[EntityT, ExcerptT, CacheT]) MergeAll(remote string) <-chan entity.MergeResult {
537 out := make(chan entity.MergeResult)

Callers

nothing calls this directly

Calls 6

writeMethod · 0.95
LockMethod · 0.65
RemoveAllMethod · 0.65
RemoveMethod · 0.65
GetIndexMethod · 0.65
ClearMethod · 0.65

Tested by

no test coverage detected