aboutsummaryrefslogtreecommitdiffstats
path: root/storage/memory/storage.go
diff options
context:
space:
mode:
authorMiguel Molina <miguel@erizocosmi.co>2018-07-27 15:36:04 +0200
committerGitHub <noreply@github.com>2018-07-27 15:36:04 +0200
commit0ade8fb60e759da42f8779b2a5c8a3f422ce4d69 (patch)
tree85d416c7ab1393be6a00ca8b3851e3ff8dc3e67e /storage/memory/storage.go
parentb7131019e6b2639f69623029a5a1f178bc920a4e (diff)
parentccd0fa0bc17f0680038529b00f5c5a44f8e77b41 (diff)
downloadgo-git-0ade8fb60e759da42f8779b2a5c8a3f422ce4d69.tar.gz
Merge pull request #899 from erizocosmico/feature/new-packfile
plumbing: packfile, new Packfile representation
Diffstat (limited to 'storage/memory/storage.go')
-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{}
}