message: Handle first commit scenario
diff: @@ -484,7 +484,7 @@ public class AuditServiceImpl implements AuditService {
  //New commit has ONLY one parent
  List<String> parentCommitShas = commit.getScmParentRevisionNumbers();
  if (!CollectionUtils.isEmpty(parentCommitShas)) {
  - computeParentCommit(parentCommitShas.get(0), peerReviewResponse, baseSha, headSha, pr);
  + computeParentCommit(parentCommitShas.get(0), peerReviewResponse, baseSha, headSha, pr, mapCommitsRelatedToPr);
  }
  }
  @@ -552,7 +552,7 @@ public class AuditServiceImpl implements AuditService {
  return allPeerReviews;
  }
  - private boolean computeParentCommit(String commitSha, PeerReviewResponse peerReviewResponse, String baseSha, String headSha, GitRequest pr) {
  + private boolean computeParentCommit(String commitSha, PeerReviewResponse peerReviewResponse, String baseSha, String headSha, GitRequest pr, HashMap<String, Commit> mapCommitsRelatedToPr) {
  boolean traceBack = true;
  Commit commit = commitRepository.findByScmRevisionNumberAndScmUrlIgnoreCase(commitSha, pr.getScmUrl());
  if (commit == null || commit.getType() == null || commit.getType() == CommitType.Merge || commit.getType() == CommitType.NotBuilt) {
  @@ -561,15 +561,24 @@ public class AuditServiceImpl implements AuditService {
  LOGGER.warn("Enter computeParentCommit " + commitSha + " " + commit.getType());
  while (traceBack) {
  if (commit.getScmRevisionNumber().equalsIgnoreCase(baseSha)) {
  + if (commit.getScmParentRevisionNumbers() != null) {
  + if (commit.getScmParentRevisionNumbers().isEmpty()) {
  + peerReviewResponse.addAuditStatus(AuditStatus.DIRECT_COMMITS_TO_BASE_FIRST_COMMIT);
  + } else {
  peerReviewResponse.addAuditStatus(AuditStatus.DIRECT_COMMITS_TO_BASE);
  + }
  + } else {
  + peerReviewResponse.addAuditStatus(AuditStatus.DIRECT_COMMITS_TO_BASE_FIRST_COMMIT);
  + }
  traceBack = false;
  } else if (commit.getScmRevisionNumber().equalsIgnoreCase(headSha)) {
  traceBack = false;
  } else {
  + mapCommitsRelatedToPr.put(commitSha, commit);
  //New commit has ONLY one parent
  List<String> parentCommitShas = commit.getScmParentRevisionNumbers();
  if (!CollectionUtils.isEmpty(parentCommitShas)) {
  - traceBack = computeParentCommit(parentCommitShas.get(0), peerReviewResponse, baseSha, headSha, pr);
  + traceBack = computeParentCommit(parentCommitShas.get(0), peerReviewResponse, baseSha, headSha, pr, mapCommitsRelatedToPr);
  } else {
  //reached first commit
  traceBack = false;
  