code: func CachedRemoteRefs(remoteName string) ([]*Ref, error) {
  	var ret []*Ref
  	cmd := gitNoLFS("show-ref")
  
  	outp, err := cmd.StdoutPipe()
  	if err != nil {
  		return nil, fmt.Errorf("Failed to call git show-ref: %v", err)
  	}
  	cmd.Start()
  	scanner := bufio.NewScanner(outp)
  
  	r := regexp.MustCompile(fmt.Sprintf(`([0-9a-fA-F]{40})\s+refs/remotes/%v/(.*)`, remoteName))
  	for scanner.Scan() {
  		if match := r.FindStringSubmatch(scanner.Text()); match != nil {
  			name := strings.TrimSpace(match[2])
  			// Don't match head
  			if name == "HEAD" {
  				continue
  			}
  
  			sha := match[1]
  			ret = append(ret, &Ref{name, RefTypeRemoteBranch, sha})
  		}
  	}
  	return ret, cmd.Wait()
  }
docs: // CachedRemoteRefs returns the list of branches & tags for a remote which are
  // currently cached locally. No remote request is made to verify them.