aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorMiguel Molina <miguel@erizocosmi.co>2018-07-27 15:07:25 +0200
committerMiguel Molina <miguel@erizocosmi.co>2018-07-27 15:07:25 +0200
commitccd0fa0bc17f0680038529b00f5c5a44f8e77b41 (patch)
treecfdc44429694b5f727404a0e60dd75f552621524 /storage
parentffdfb7dbabb78090b27ca29b762b803969c89fd7 (diff)
downloadgo-git-ccd0fa0bc17f0680038529b00f5c5a44f8e77b41.tar.gz
plumbing: packfile, lazy object reads with DiskObjects
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Diffstat (limited to 'storage')
-rw-r--r--storage/memory/storage.go10
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{}
}