code: func encodeRefs(e *advRefsEncoder) encoderStateFn {
  	for _, r := range e.sortedRefs {
  		if r == e.firstRefName {
  			continue
  		}
  
  		hash := e.data.References[r]
  		if e.err = e.pe.Encodef("%s %s\n", hash.String(), r); e.err != nil {
  			return nil
  		}
  
  		if hash, ok := e.data.Peeled[r]; ok {
  			if e.err = e.pe.Encodef("%s %s^{}\n", hash.String(), r); e.err != nil {
  				return nil
  			}
  		}
  	}
  
  	return encodeShallow
  }
docs: // Adds the (sorted) refs: hash SP refname EOL
  // and their peeled refs if any.