public static @NotNull Pair<VcsLogStorage, @Nullable VcsLogStorageBackend> createStorageAndIndexBackend(@NotNull Project project,
                                                                                                          @NotNull String logId,
                                                                                                          @NotNull Map<VirtualFile, VcsLogProvider> logProviders,
                                                                                                          @NotNull Set<VirtualFile> indexingRoots,
                                                                                                          @NotNull VcsLogErrorHandler errorHandler,
                                                                                                          @NotNull Disposable parent)
    throws IOException {
    StorageId.Directory hashesStorageId = new StorageId.Directory(project.getName(), HASHES_STORAGE, logId, VERSION);
    StorageId.Directory refsStorageId = new StorageId.Directory(project.getName(), REFS_STORAGE, logId, VERSION + REFS_VERSION);
    StorageId.Directory indexStorageId = PhmVcsLogStorageBackend.getIndexStorageId(project, logId);

    List<StorageId.Directory> storageIds = List.of(hashesStorageId, refsStorageId, indexStorageId);

    return IOUtil.openCleanOrResetBroken(() -> {
      VcsLogStorageImpl storage = new VcsLogStorageImpl(logProviders, hashesStorageId, refsStorageId, errorHandler, parent);
      if (indexingRoots.isEmpty()) return new Pair<>(storage, null);

      try {
        VcsLogStorageBackend indexBackend = PhmVcsLogStorageBackend.create(project, storage, indexStorageId, indexingRoots, errorHandler, parent);
        return new Pair<>(storage, indexBackend);
      }
      catch (ProcessCanceledException e) {
        throw e;
      }
      catch (Throwable e) {
        LOG.error("Could not create index storage backend", e);
        return new Pair<>(storage, null);
      }
    }, () -> {
      for (StorageId.Directory storageId : storageIds) {
        if (!storageId.cleanupAllStorageFiles()) {
          LOG.error("Could not clean up storage files in " + storageId.getStoragePath());
        }
      }
    });
  }
public static @NotNull Pair<VcsLogStorage, @Nullable VcsLogStorageBackend> createStorageAndIndexBackend(@NotNull Project project,
                                                                                                          @NotNull String logId,
                                                                                                          @NotNull Map<VirtualFile, VcsLogProvider> logProviders,
                                                                                                          @NotNull Set<VirtualFile> indexingRoots,
                                                                                                          @NotNull VcsLogErrorHandler errorHandler,
                                                                                                          @NotNull Disposable parent)