GHRepository repository = gitHub.getRepository(repoName); GHCommit commit = repository.getCommit(currentCommitId); parentCommitId = commit.getParents().get(0).getSHA1(); List<GHCommit.File> commitFiles = commit.getFiles(); for (GHCommit.File commitFile : commitFiles) {
try { GHCommit commitMerge = ghRepo.getCommit(build.getCommit().getSha()); base = commitMerge.getParents().get(0); head = commitMerge.getParents().get(1); } catch (FileNotFoundException e) { this.getLogger().error("The merge commit was deleted from Github: it means the previous commit information can't be get.");