private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection<? extends GitRepository> repositories) {
    // TODO links to 'rebase', 'resolve conflicts', etc.
    for (GitRepository repository : repositories) {
      Repository.State state = repository.getState();
      String repositoryName = getShortRepositoryName(repository);
      String message = switch (state) {
        case NORMAL, DETACHED -> {
          if (repository.isFresh()) {
            yield GitBundle.message("rebase.notification.not.allowed.empty.repository.message", repositoryName);
          }
          yield null;
        }
        case MERGING -> new HtmlBuilder()
          .append(GitBundle.message("rebase.notification.not.allowed.merging.message.first", repositoryName)).br()
          .append(GitBundle.message("rebase.notification.not.allowed.merging.message.second"))
          .toString();
        case REBASING -> new HtmlBuilder()
          .append(GitBundle.message("rebase.notification.not.allowed.rebasing.message.first", repositoryName)).br()
          .append(GitBundle.message("rebase.notification.not.allowed.rebasing.message.second"))
          .toString();
        case GRAFTING -> new HtmlBuilder()
          .append(GitBundle.message("rebase.notification.not.allowed.grafting.message.first", repositoryName)).br()
          .append(GitBundle.message("rebase.notification.not.allowed.grafting.message.second"))
          .toString();
        case REVERTING -> new HtmlBuilder()
          .append(GitBundle.message("rebase.notification.not.allowed.reverting.message.first", repositoryName)).br()
          .append(GitBundle.message("rebase.notification.not.allowed.reverting.message.second"))
          .toString();
      };
      if (message != null) {
        VcsNotifier.getInstance(project).notifyError(
          REBASE_NOT_ALLOWED,
          GitBundle.message("rebase.notification.not.allowed.title"),
          message
        );
        return false;
      }
    }
    return true;
  }
private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection<? extends GitRepository> repositories)