diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-06-11 10:21:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-11 10:21:14 +0200 |
commit | e7cf6d22593c8fcdd393b0da9d922c670b61a199 (patch) | |
tree | 88fa5da0c9fe6c01860d0cda8850db33d7c0078e /storage/filesystem/object.go | |
parent | b23570073eaee3489e5e3d666f22ba5cbeb53243 (diff) | |
parent | ecd2bd553ce223252d9784572fd47bd9f597618e (diff) | |
download | go-git-e7cf6d22593c8fcdd393b0da9d922c670b61a199.tar.gz |
Merge pull request #857 from erizocosmico/feature/object-storage-public
storage: filesystem, make ObjectStorage constructor public
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r-- | storage/filesystem/object.go | 5 |
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 } |