aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/storer
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2017-11-15 18:33:41 +0200
committerJeremy Stribling <strib@alum.mit.edu>2017-11-29 11:01:18 -0800
commitfae438980c3e17cb04f84ce92b99cd3c835e3e18 (patch)
tree49897b1fef2644f332015a7d7f3333c3e6c935e8 /plumbing/storer
parent3f0b1ff37b64108cfed1b57ea4ae1f1566592905 (diff)
downloadgo-git-fae438980c3e17cb04f84ce92b99cd3c835e3e18.tar.gz
Support for repacking objects
Diffstat (limited to 'plumbing/storer')
-rw-r--r--plumbing/storer/object.go5
-rw-r--r--plumbing/storer/object_test.go4
2 files changed, 9 insertions, 0 deletions
diff --git a/plumbing/storer/object.go b/plumbing/storer/object.go
index bd34be8..29e0090 100644
--- a/plumbing/storer/object.go
+++ b/plumbing/storer/object.go
@@ -52,6 +52,11 @@ type EncodedObjectStorer interface {
LooseObjectTime(plumbing.Hash) (time.Time, error)
// DeleteLooseObject deletes a loose object if it exists.
DeleteLooseObject(plumbing.Hash) error
+ // ObjectPacks returns hashes of object packs if the underlying
+ // implementation has pack files.
+ ObjectPacks() ([]plumbing.Hash, error)
+ // DeleteObjectPackAndIndex deletes an object pack and the corresponding index file if they exist.
+ DeleteObjectPackAndIndex(plumbing.Hash) error
}
// DeltaObjectStorer is an EncodedObjectStorer that can return delta
diff --git a/plumbing/storer/object_test.go b/plumbing/storer/object_test.go
index f8b1f73..68e8e10 100644
--- a/plumbing/storer/object_test.go
+++ b/plumbing/storer/object_test.go
@@ -161,3 +161,7 @@ func (o *MockObjectStorage) LooseObjectTime(plumbing.Hash) (time.Time, error) {
func (o *MockObjectStorage) DeleteLooseObject(plumbing.Hash) error {
return plumbing.ErrObjectNotFound
}
+
+func (o *MockObjectStorage) ObjectPacks() ([]plumbing.Hash, error) {
+ return nil, nil
+}