public static @Nullable File getRebaseDir(@NotNull Project project, @NotNull VirtualFile root) {
    GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRootQuick(root);
    if (repository == null) return null;

    File f = repository.getRepositoryFiles().getRebaseApplyDir();
    if (f.exists()) {
      return f;
    }
    f = repository.getRepositoryFiles().getRebaseMergeDir();
    if (f.exists()) {
      return f;
    }
    return null;
  }
public static @Nullable File getRebaseDir(@NotNull Project project, @NotNull VirtualFile root)