aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
authorJavier Peletier <jm@epiclabs.io>2018-11-12 01:35:10 +0100
committerJavier Peletier <jm@epiclabs.io>2018-11-12 01:35:46 +0100
commitff47322984fc3d5ba2738ee4a996b88f744a2fe7 (patch)
tree5016ba1706bbb047786e8bee0b012b0748cdc15f /storage/filesystem/object.go
parentcd64b4d630b6c2d2b3d72e9615e14f9d58bb5787 (diff)
downloadgo-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.go5
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 {