diff options
author | Javier Peletier <jm@epiclabs.io> | 2018-11-12 01:35:10 +0100 |
---|---|---|
committer | Javier Peletier <jm@epiclabs.io> | 2018-11-12 01:35:46 +0100 |
commit | ff47322984fc3d5ba2738ee4a996b88f744a2fe7 (patch) | |
tree | 5016ba1706bbb047786e8bee0b012b0748cdc15f /storage/filesystem/object.go | |
parent | cd64b4d630b6c2d2b3d72e9615e14f9d58bb5787 (diff) | |
download | go-git-ff47322984fc3d5ba2738ee4a996b88f744a2fe7.tar.gz |
storage/filesystem: Added reindex method to reindex packfiles
Signed-off-by: Javier Peletier <jm@epiclabs.io>
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r-- | storage/filesystem/object.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go index 6cd2d4c..57dcbb4 100644 --- a/storage/filesystem/object.go +++ b/storage/filesystem/object.go @@ -61,6 +61,11 @@ func (s *ObjectStorage) requireIndex() error { return nil } +// Reindex indexes again all packfiles. Useful if git changed packfiles externally +func (s *ObjectStorage) Reindex() { + s.index = nil +} + func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) (err error) { f, err := s.dir.ObjectPackIdx(h) if err != nil { |