public static void run(@NotNull Project project, @NotNull Runnable action) {
    ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
    vcsManager.startBackgroundVcsOperation();
    try {
      action.run();
    }
    finally {
      if (getApplication().isDispatchThread()) {
        getApplication().executeOnPooledThread(() -> vcsManager.stopBackgroundVcsOperation());
      }
      else {
        vcsManager.stopBackgroundVcsOperation();
      }
    }
  }
public static void run(@NotNull Project project, @NotNull Runnable action)