@NotNull private static DiffDescription getDefaultDescriptionMessage( @NotNull String branch, @Nullable DiffInfo info, @NotNull GitRepository gitRepository) { if (info == null) { return new DiffDescription(branch, null, null); } if (info.getInfo().getBranchToHeadCommits(gitRepository).size() != 1) { return new DiffDescription(branch, info.getFrom(), null); } GitCommit commit = info.getInfo().getBranchToHeadCommits(gitRepository).get(0); return new DiffDescription(branch, commit.getSubject(), commit.getFullMessage()); }
public void showDiffDialog(@NotNull String branch) { if (canShowDiff()) { DiffInfo info = getDiffInfoWithModal(branch); if (info == null) { GithubNotifications.showErrorDialog(myProject, "Can't Show Diff", "Can't get diff info"); return; } GitCompareBranchesDialog dialog = new GitCompareBranchesDialog( myProject, info.getTo(), info.getFrom(), info.getInfo(), myGitRepository); dialog.show(); } }