code: func encodeFirstLine(e *advRefsEncoder) encoderStateFn {
  	const formatFirstLine = "%s %s\x00%s\n"
  	var firstLine string
  	capabilities := formatCaps(e.data.Capabilities)
  
  	if e.firstRefName == "" {
  		firstLine = fmt.Sprintf(formatFirstLine, plumbing.ZeroHash.String(), "capabilities^{}", capabilities)
  	} else {
  		firstLine = fmt.Sprintf(formatFirstLine, e.firstRefHash.String(), e.firstRefName, capabilities)
  
  	}
  
  	if e.err = e.pe.EncodeString(firstLine); e.err != nil {
  		return nil
  	}
  
  	return encodeRefs
  }
docs: // Adds the first pkt-line payload: head hash, head ref and capabilities.
  // If HEAD ref is not found, the first reference ordered in increasing order will be used.
  // If there aren't HEAD neither refs, the first line will be "PKT-LINE(zero-id SP "capabilities^{}" NUL capability-list)".
  // See: https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt
  // See: https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt