@Override
  protected @NotNull Collection<Change> getDiffChanges(@NotNull Project project, @NotNull VirtualFile file,
                                                       @NotNull String branchName) throws VcsException {
    FilePath filePath = VcsUtil.getFilePath(file);
    final GitRepository gitRepository = GitUtil.getRepositoryForFile(project, file);
    GitBranch branch = gitRepository.getBranches().findBranchByName(branchName);
    String branchToCompare = branch != null ? branch.getFullName() : branchName;

    final VirtualFile gitRepositoryRoot = gitRepository.getRoot();
    GitRevisionNumber compareRevisionNumber = new GitRevisionNumber(branchToCompare);
    Collection<Change> changes =
      GitChangeUtils.getDiffWithWorkingDir(project, gitRepositoryRoot, branchToCompare, Collections.singletonList(filePath), false);
    // if git returned no changes, we need to check that file exists in compareWith branch to avoid this error in diff dialog
    // a.e. when you perform compareWith for unversioned file
    if (changes.isEmpty() && GitHistoryUtils.getCurrentRevision(project, filePath, branchToCompare) == null) {
      throw new VcsException(fileDoesntExistInBranchError(file, branchToCompare));
    }
    ContentRevision revision = GitContentRevision.createRevision(filePath, compareRevisionNumber, project);
    return changes.isEmpty() && !filePath.isDirectory() ? createChangesWithCurrentContentForFile(filePath, revision) : changes;
  }
@Override
  protected @NotNull Collection<Change> getDiffChanges(@NotNull Project project, @NotNull VirtualFile file,
                                                       @NotNull String branchName)