code: func decodeFirstRef(l *advRefsDecoder) decoderStateFn {
  	if len(l.line) < 3 {
  		l.error("line too short after hash")
  		return nil
  	}
  
  	if !bytes.HasPrefix(l.line, sp) {
  		l.error("no space after hash")
  		return nil
  	}
  	l.line = l.line[1:]
  
  	chunks := bytes.SplitN(l.line, null, 2)
  	if len(chunks) < 2 {
  		l.error("NULL not found")
  		return nil
  	}
  	ref := chunks[0]
  	l.line = chunks[1]
  
  	if bytes.Equal(ref, []byte(head)) {
  		l.data.Head = &l.hash
  	} else {
  		l.data.References[string(ref)] = l.hash
  	}
  
  	return decodeCaps
  }
docs: // decode the refname, expects SP refname NULL