aboutsummaryrefslogtreecommitdiffstats
path: root/tree.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-02-17 00:24:31 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-02-17 11:46:00 +0100
commita964e32d92c53a47ce7c46d589a18c62133b8c50 (patch)
tree4c094cd6afb95cb2832f866b9411276418435819 /tree.go
parent1ac00554c3b5f88d2ddc2e28e7cfcdcad9d9f4bb (diff)
downloadgo-git-a964e32d92c53a47ce7c46d589a18c62133b8c50.tar.gz
storages: memory object
Diffstat (limited to 'tree.go')
-rw-r--r--tree.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tree.go b/tree.go
index 4a964a4..e57d315 100644
--- a/tree.go
+++ b/tree.go
@@ -151,6 +151,10 @@ func (t *Tree) walkEntries(base string, ch chan *File) {
// Decode transform an core.Object into a Tree struct
func (t *Tree) Decode(o core.Object) error {
+ if o.Type() != core.TreeObject {
+ return ErrUnsupportedObject
+ }
+
t.Hash = o.Hash()
if o.Size() == 0 {
return nil