@ApiStatus.Obsolete
  public static @Nullable VirtualFile findGitRootFor(@NotNull Path path) {
    try {
      Path root = path;
      while (root != null) {
        if (isGitRoot(root)) {
          return LocalFileSystem.getInstance().findFileByNioFile(root);
        }
        root = root.getParent();
      }
      return null;
    }
    catch (InvalidPathException e) {
      LOG.warn(e.getMessage());
      return null;
    }
  }
@ApiStatus.Obsolete
  public static @Nullable VirtualFile findGitRootFor(@NotNull Path path)