From fae438980c3e17cb04f84ce92b99cd3c835e3e18 Mon Sep 17 00:00:00 2001 From: Taru Karttunen Date: Wed, 15 Nov 2017 18:33:41 +0200 Subject: Support for repacking objects --- plumbing/storer/object.go | 5 +++++ plumbing/storer/object_test.go | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'plumbing') 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 +} -- cgit