export const getCompareUrl = (commitInfo) => {
  const previousCommitUrl = commitInfo.getIn(['previous', 'url']);
  const currentCommitId = commitInfo.getIn(['current', 'id']);
  return `${previousCommitUrl.replace('/commit/', '/compare/')}...${currentCommitId}`;
};

export const getCompareUrl = (commitInfo) => {
  const previousCommitUrl = commitInfo.getIn(['previous', 'url']);
  const currentCommitId = commitInfo.getIn(['current', 'id']);

  if (!previousCommitUrl || !currentCommitId) {
    return '';
  }

  return `${previousCommitUrl.replace('/commit/', '/compare/')}...${currentCommitId}`;
};

Fix error when there is no previous commit
Fix error when there is no previous commit
