aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-18 23:28:06 -0800
committerJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-18 23:37:11 -0800
commit5e100bdb6c60e961730af19ab1691a0d3605de12 (patch)
tree4ae877daab57495e04af3de477d75647a7f1671b /storage
parentf23141ac004d672bb8ea22a709b8c3ed1cdb8b89 (diff)
downloadgo-git-5e100bdb6c60e961730af19ab1691a0d3605de12.tar.gz
Added support for annotated tags
Diffstat (limited to 'storage')
-rw-r--r--storage/memory/storage.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/memory/storage.go b/storage/memory/storage.go
index 9bc1e7b..fe92256 100644
--- a/storage/memory/storage.go
+++ b/storage/memory/storage.go
@@ -14,6 +14,7 @@ type ObjectStorage struct {
Commits map[core.Hash]core.Object
Trees map[core.Hash]core.Object
Blobs map[core.Hash]core.Object
+ Tags map[core.Hash]core.Object
}
// NewObjectStorage returns a new empty ObjectStorage
@@ -23,6 +24,7 @@ func NewObjectStorage() *ObjectStorage {
Commits: make(map[core.Hash]core.Object, 0),
Trees: make(map[core.Hash]core.Object, 0),
Blobs: make(map[core.Hash]core.Object, 0),
+ Tags: make(map[core.Hash]core.Object, 0),
}
}
@@ -43,6 +45,8 @@ func (o *ObjectStorage) Set(obj core.Object) (core.Hash, error) {
o.Trees[h] = o.Objects[h]
case core.BlobObject:
o.Blobs[h] = o.Objects[h]
+ case core.TagObject:
+ o.Tags[h] = o.Objects[h]
default:
return h, ErrUnsupportedObjectType
}
@@ -70,6 +74,8 @@ func (o *ObjectStorage) Iter(t core.ObjectType) core.ObjectIter {
series = flattenObjectMap(o.Trees)
case core.BlobObject:
series = flattenObjectMap(o.Blobs)
+ case core.TagObject:
+ series = flattenObjectMap(o.Tags)
}
return core.NewObjectSliceIter(series)
}