code: func decodeFirstHash(p *advRefsDecoder) decoderStateFn {
  	// If the repository is empty, we receive a flush here (HTTP).
  	if isFlush(p.line) {
  		p.err = ErrEmptyAdvRefs
  		return nil
  	}
  
  	if len(p.line) < hashSize {
  		p.error("cannot read hash, pkt-line too short")
  		return nil
  	}
  
  	if _, err := hex.Decode(p.hash[:], p.line[:hashSize]); err != nil {
  		p.error("invalid hash text: %s", err)
  		return nil
  	}
  
  	p.line = p.line[hashSize:]
  
  	if p.hash.IsZero() {
  		return decodeSkipNoRefs
  	}
  
  	return decodeFirstRef
  }
docs: // If the first hash is zero, then a no-refs is coming. Otherwise, a
  // list-of-refs is coming, and the hash will be followed by the first
  // advertised ref.