diff options
Diffstat (limited to 'tree.go')
-rw-r--r-- | tree.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |