code: func (a *AdvRefs) Encode(w io.Writer) error {
  	e := newAdvRefsEncoder(w)
  	return e.Encode(a)
  }
docs: // Encode writes the AdvRefs encoding to a writer.
  //
  // All the payloads will end with a newline character. Capabilities,
  // references and shallows are written in alphabetical order, except for
  // peeled references that always follow their corresponding references.