function getAncestorHashForBranch(hash, baseBranch) {
  const result = runCommandsUntilFirstSuccess([
    ['git', ['merge-base', hash, `origin/${baseBranch}`]],
    ['git', ['merge-base', hash, baseBranch]],
  ]);

  // Ancestor hash is optional, so do not throw if it can't be computed.
  // See https://github.com/GoogleChrome/lighthouse-ci/issues/36
  if (result.status !== 0) return '';

  return result.stdout.trim();
}
@param {string} hash
@param {string} baseBranch
@return {string}