code: func LocalRefs() ([]*Ref, error) {
  	cmd := gitNoLFS("show-ref", "--heads", "--tags")
  
  	outp, err := cmd.StdoutPipe()
  	if err != nil {
  		return nil, fmt.Errorf("Failed to call git show-ref: %v", err)
  	}
  
  	var refs []*Ref
  
  	if err := cmd.Start(); err != nil {
  		return refs, err
  	}
  
  	scanner := bufio.NewScanner(outp)
  	for scanner.Scan() {
  		line := strings.TrimSpace(scanner.Text())
  		parts := strings.SplitN(line, " ", 2)
  		if len(parts) != 2 || len(parts[0]) != 40 || len(parts[1]) < 1 {
  			tracerx.Printf("Invalid line from git show-ref: %q", line)
  			continue
  		}
  
  		rtype, name := ParseRefToTypeAndName(parts[1])
  		if rtype != RefTypeLocalBranch && rtype != RefTypeLocalTag {
  			continue
  		}
  
  		refs = append(refs, &Ref{name, rtype, parts[0]})
  	}
  
  	return refs, cmd.Wait()
  }
docs: // Refs returns all of the local and remote branches and tags for the current
  // repository. Other refs (HEAD, refs/stash, git notes) are ignored.