diff --git a/pygitweb/main.py b/pygitweb/main.py
index 3f37278..b3b22e3 100644
--- a/pygitweb/main.py
+++ b/pygitweb/main.py
@@ -36,7 +36,6 @@ from pygitweb.git_helpers import (
     parse_commit,
 )
 from pygitweb.projects import (
-    filter_forks_from_projects_list,
     git_get_projects_list,
     git_get_project_list_from_file,
     git_get_project_owner,
@@ -176,9 +175,6 @@ def git_project_list(
     )
     if not list_:
         raise HTTPException(status_code=404, detail="No projects found")
-    
-    # todo
-    # list_ = filter_forks_from_projects_list(list_)
 
     # We need better escaping logic here but can wait until we harden the templates
     table = env.get_template("table.html").render(
diff --git a/pygitweb/projects.py b/pygitweb/projects.py
index c5bc7d4..18186c7 100644
--- a/pygitweb/projects.py
+++ b/pygitweb/projects.py
@@ -1,5 +1,5 @@
 """
-Project list: get_projects_list, filter_forks, search_projects_list, project_in_list,
+Project list: get_projects_list, search_projects_list, project_in_list,
 get_project_owner, get_project_list_from_file, get_last_activity.
 Ported from gitweb/gitweb.perl.
 """
@@ -10,6 +10,8 @@ import re
 from pathlib import Path
 from typing import Any, Callable
 
+import pygit2
+
 from pygitweb.config import PROJECTROOT, PROJECTS_LIST, PROJECT_MAXDEPTH, LIST_ALL
 from pygitweb.validation import check_export_ok
 
@@ -55,6 +57,9 @@ def _find_projects_in_dir(
                     continue
             except OSError:
                 continue
+            repo = pygit2.discover_repository(path)
+            if not repo:
+                continue
             project_path = os.path.relpath(path, PROJECTROOT)
             project_path = project_path.replace("\\", "/")
             git_dir = os.path.join(PROJECTROOT, project_path)
@@ -171,47 +176,6 @@ def git_get_last_activity(project: str, projectroot: str = PROJECTROOT) -> int |
     return co.get("committer_epoch")
 
 
-def filter_forks_from_projects_list(
-    projects: list[dict[str, Any]],
-    projectroot: str = PROJECTROOT,
-) -> list[dict[str, Any]]:
-    """Remove forks from list; set 'forks' on each project. Port of filter_forks_from_projects_list."""
-    trie: dict[str, Any] = {}
-    for pr in projects:
-        path = pr.get("path", "")
-        path_no_git = path.replace(".git", "")
-        if path_no_git.endswith("/") or not path_no_git:
-            pr["forks"] = []
-            continue
-        if not os.path.isdir(os.path.join(projectroot, path)):
-            pr["forks"] = []
-            continue
-        pr["forks"] = []
-        dirs = path_no_git.split("/")
-        ref = trie
-        for d in dirs:
-            ref = ref.setdefault(d, {})
-        ref[""] = pr
-
-    filtered = []
-    for pr in projects:
-        path = pr.get("path", "")
-        dirs = path.split("/")
-        ref = trie
-        for d in dirs:
-            if "" in ref:
-                ref[""].setdefault("forks", []).append(pr)
-                break
-            if d not in ref:
-                filtered.append(pr)
-                break
-            ref = ref[d]
-        else:
-            if "" not in ref:
-                filtered.append(pr)
-    return filtered
-
-
 def search_projects_list(
     projlist: list[dict[str, Any]],
     tagfilter: str | None = None,
