code: func (r *ReferenceUpdateRequest) Encode(w io.Writer) error {
  	if err := r.validate(); err != nil {
  		return err
  	}
  
  	e := pktline.NewEncoder(w)
  
  	if err := r.encodeShallow(e, r.Shallow); err != nil {
  		return err
  	}
  
  	if err := r.encodeCommands(e, r.Commands, r.Capabilities); err != nil {
  		return err
  	}
  
  	if r.Packfile != nil {
  		if _, err := io.Copy(w, r.Packfile); err != nil {
  			return err
  		}
  
  		return r.Packfile.Close()
  	}
  
  	return nil
  }
docs: // Encode writes the ReferenceUpdateRequest encoding to the stream.