code: func decodeShallow(p *advRefsDecoder) decoderStateFn {
  	if !bytes.HasPrefix(p.line, shallow) {
  		p.error("malformed shallow prefix, found %q... instead", p.line[:len(shallow)])
  		return nil
  	}
  	p.line = bytes.TrimPrefix(p.line, shallow)
  
  	if len(p.line) != hashSize {
  		p.error(fmt.Sprintf(
  			"malformed shallow hash: wrong length, expected 40 bytes, read %d bytes",
  			len(p.line)))
  		return nil
  	}
  
  	text := p.line[:hashSize]
  	var h plumbing.Hash
  	if _, err := hex.Decode(h[:], text); err != nil {
  		p.error("invalid hash text: %s", err)
  		return nil
  	}
  
  	p.data.Shallows = append(p.data.Shallows, h)
  
  	if ok := p.nextLine(); !ok {
  		return nil
  	}
  
  	if len(p.line) == 0 {
  		return nil // succesfull parse of the advertised-refs message
  	}
  
  	return decodeShallow
  }
docs: // Keeps reading shallows until a flush-pkt is found