diff options
author | Miguel Molina <miguel@erizocosmi.co> | 2018-07-27 15:07:25 +0200 |
---|---|---|
committer | Miguel Molina <miguel@erizocosmi.co> | 2018-07-27 15:07:25 +0200 |
commit | ccd0fa0bc17f0680038529b00f5c5a44f8e77b41 (patch) | |
tree | cfdc44429694b5f727404a0e60dd75f552621524 /storage/memory/storage.go | |
parent | ffdfb7dbabb78090b27ca29b762b803969c89fd7 (diff) | |
download | go-git-ccd0fa0bc17f0680038529b00f5c5a44f8e77b41.tar.gz |
plumbing: packfile, lazy object reads with DiskObjects
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Diffstat (limited to 'storage/memory/storage.go')
-rw-r--r-- | storage/memory/storage.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/memory/storage.go b/storage/memory/storage.go index 2e32509..a950a62 100644 --- a/storage/memory/storage.go +++ b/storage/memory/storage.go @@ -91,6 +91,16 @@ type ObjectStorage struct { Tags map[plumbing.Hash]plumbing.EncodedObject } +func NewObjectStorage() *ObjectStorage { + return &ObjectStorage{ + Objects: make(map[plumbing.Hash]plumbing.EncodedObject), + Commits: make(map[plumbing.Hash]plumbing.EncodedObject), + Trees: make(map[plumbing.Hash]plumbing.EncodedObject), + Blobs: make(map[plumbing.Hash]plumbing.EncodedObject), + Tags: make(map[plumbing.Hash]plumbing.EncodedObject), + } +} + func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject { return &plumbing.MemoryObject{} } |