Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit e0781c6

Browse files
committed
storage/filesystem: Added reindex method to reindex packfiles
1 parent cd64b4d commit e0781c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

storage/filesystem/object.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ func (s *ObjectStorage) requireIndex() error {
6161
return nil
6262
}
6363

64+
// Reindex indexes again all packfiles. Useful if git changed packfiles externally
65+
func (s *ObjectStorage) Reindex() {
66+
s.index = nil
67+
}
68+
6469
func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) (err error) {
6570
f, err := s.dir.ObjectPackIdx(h)
6671
if err != nil {

0 commit comments

Comments
 (0)