private void loadFileHistoryInBackground(@NotNull GitFileAnnotation fileAnnotation) {
    List<VcsFileRevision> fileRevisions = BackgroundTaskUtil.computeInBackgroundAndTryWait(
      () -> {
        VirtualFile file = fileAnnotation.getFile();
        FilePath filePath = VcsUtil.getFilePath(file);
        VcsRevisionNumber currentRevision = fileAnnotation.getCurrentRevision();

        GitRepository repository = GitRepositoryManager.getInstance(myProject).getRepositoryForFile(file);
        if (repository == null) return null;

        return BackgroundTaskUtil.runUnderDisposeAwareIndicator(repository, () -> {
          try {
            if (file.isInLocalFileSystem() || currentRevision == null) {
              return loadFileHistory(filePath);
            }
            else {
              return GitFileHistory.collectHistoryForRevision(myProject, filePath, currentRevision);
            }
          }
          catch (VcsException e) {
            LOG.warn(e);
            return null;
          }
        });
      },
      (revisions) -> {
        if (revisions == null) return;

        GitFileAnnotation newFileAnnotation =
          new GitFileAnnotation(fileAnnotation.getProject(),
                                fileAnnotation.getFile(),
                                fileAnnotation.getFilePath(),
                                fileAnnotation.getCurrentRevision(),
                                fileAnnotation.getLines());
        newFileAnnotation.setRevisions(revisions);

        ApplicationManager.getApplication().invokeLater(() -> {
          fileAnnotation.reload(newFileAnnotation);
        }, myProject.getDisposed());
      },
      ProgressIndicatorWithDelayedPresentation.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS
    );

    if (fileRevisions != null) {
      fileAnnotation.setRevisions(fileRevisions);
    }
  }
private void loadFileHistoryInBackground(@NotNull GitFileAnnotation fileAnnotation)