code: func (t *Tree) Decode(o plumbing.EncodedObject) (err error) {
  	if o.Type() != plumbing.TreeObject {
  		return ErrUnsupportedObject
  	}
  
  	t.Hash = o.Hash()
  	if o.Size() == 0 {
  		return nil
  	}
  
  	t.Entries = nil
  	t.m = nil
  
  	reader, err := o.Reader()
  	if err != nil {
  		return err
  	}
  	defer ioutil.CheckClose(reader, &err)
  
  	r := bufPool.Get().(*bufio.Reader)
  	defer bufPool.Put(r)
  	r.Reset(reader)
  	for {
  		str, err := r.ReadString(' ')
  		if err != nil {
  			if err == io.EOF {
  				break
  			}
  
  			return err
  		}
  		str = str[:len(str)-1] // strip last byte (' ')
  
  		mode, err := filemode.New(str)
  		if err != nil {
  			return err
  		}
  
  		name, err := r.ReadString(0)
  		if err != nil && err != io.EOF {
  			return err
  		}
  
  		var hash plumbing.Hash
  		if _, err = io.ReadFull(r, hash[:]); err != nil {
  			return err
  		}
  
  		baseName := name[:len(name)-1]
  		t.Entries = append(t.Entries, TreeEntry{
  			Hash: hash,
  			Mode: mode,
  			Name: baseName,
  		})
  	}
  
  	return nil
  }
docs: // Decode transform an plumbing.EncodedObject into a Tree struct