aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
authorMiguel Molina <miguel@erizocosmi.co>2018-06-08 12:31:15 +0200
committerMiguel Molina <miguel@erizocosmi.co>2018-06-08 14:31:01 +0200
commitecd2bd553ce223252d9784572fd47bd9f597618e (patch)
tree88fa5da0c9fe6c01860d0cda8850db33d7c0078e /storage/filesystem/object.go
parentb23570073eaee3489e5e3d666f22ba5cbeb53243 (diff)
downloadgo-git-ecd2bd553ce223252d9784572fd47bd9f597618e.tar.gz
storage: filesystem, make ObjectStorage constructor public
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r--storage/filesystem/object.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go
index 54f268a..9ffe4dc 100644
--- a/storage/filesystem/object.go
+++ b/storage/filesystem/object.go
@@ -26,7 +26,8 @@ type ObjectStorage struct {
index map[plumbing.Hash]*packfile.Index
}
-func newObjectStorage(dir *dotgit.DotGit) (ObjectStorage, error) {
+// NewObjectStorage creates a new ObjectStorage with the given .git directory.
+func NewObjectStorage(dir *dotgit.DotGit) (ObjectStorage, error) {
s := ObjectStorage{
deltaBaseCache: cache.NewObjectLRUDefault(),
dir: dir,
@@ -166,7 +167,7 @@ func (s *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (p
// Create a new object storage with the DotGit(s) and check for the
// required hash object. Skip when not found.
for _, dg := range dotgits {
- o, oe := newObjectStorage(dg)
+ o, oe := NewObjectStorage(dg)
if oe != nil {
continue
}