()
| 51 | } |
| 52 | |
| 53 | func (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 |
| 74 | func (s *ObjectStorage) Reindex() { |
no test coverage detected