MCPcopy Index your code
hub / github.com/go-git/go-git / requireIndex

Method requireIndex

storage/filesystem/object.go:53–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53func (s *ObjectStorage) requireIndex() error {
54 if s.index != nil {
55 return nil
56 }
57
58 s.index = make(map[plumbing.Hash]idxfile.Index)
59 packs, err := s.dir.ObjectPacks()
60 if err != nil {
61 return err
62 }
63
64 for _, h := range packs {
65 if err := s.loadIdxFile(h); err != nil {
66 return err
67 }
68 }
69
70 return nil
71}
72
73// Reindex indexes again all packfiles. Useful if git changed packfiles externally
74func (s *ObjectStorage) Reindex() {

Callers 6

PackfileWriterMethod · 0.95
HasEncodedObjectMethod · 0.95
getFromPackfileMethod · 0.95
HashesWithPrefixMethod · 0.95
buildPackfileItersMethod · 0.95

Calls 2

loadIdxFileMethod · 0.95
ObjectPacksMethod · 0.65

Tested by

no test coverage detected