code: function parseRemoteBranches(str) {
    var res = [],
        regex = /[\w]{40}\s+refs\/heads\/(.+)/g,
        match;
  
    while ((match = regex.exec(str)) != null) {
      if (match.index === regex.lastIndex) {
        regex.lastIndex++;
      }
      res.push(match[1]);
    }
  
    if (!res.length) {
      throw new Error('Unable to parse ls-remote response', str);
    }
    return res;
  }
docs: Parses ls-remote --heads
  @private
  @param {String} str The 'git ls-remote --heads origin' command output
  @returns {Array<String>} the remote branches