fix: follow an upstream the port vendors as module

libretro/TIC-80 builds nesbox/TIC-80 through its core submodule
and tic80's upstream_commit is that submodule commit. Compared to
nesbox HEAD, profile_sync reported changes the shipped core never
had, and a bump would have moved the pin past it. When an upstream
pin is a submodule pointer of the source pin, its head is the
pointer at the source HEAD.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 02:45:27 +02:00
1 parent 99d9ac12c2
commit b91449590d
3 files changed
+114 -2

No files matched your search

+39
View File
@@ -673,6 +673,45 @@ def list_tree(
return paths, bool(payload.get("truncated"))
def list_gitlinks(
repo: Repo, sha: str, cache_dir: str, offline: bool = False
) -> dict[str, str]:
"""Submodule path -> the commit it points at, at one revision.
Read from the same tree listing as list_tree, so the call costs nothing
once the tree is cached.
"""
if repo.family == "gitlab":
links: dict[str, str] = {}
for page in range(1, MAX_TREE_PAGES + 1):
url = (
f"{repo.api_base}/projects/{_project(repo)}/repository/tree"
f"?ref={sha}&recursive=true&per_page={TREE_PAGE_SIZE}&page={page}"
)
payload = _api(url, cache_dir, offline)
if not isinstance(payload, list):
break
links.update(
(entry["path"], entry["id"])
for entry in payload
if isinstance(entry, dict) and entry.get("type") == "commit"
and entry.get("path") and entry.get("id")
)
if len(payload) < TREE_PAGE_SIZE:
break
return links
url = _tree_url(repo, sha)
payload = _api(url, cache_dir, offline) if url else None
if not isinstance(payload, dict):
return {}
return {
entry["path"]: entry["sha"]
for entry in payload.get("tree") or []
if isinstance(entry, dict) and entry.get("type") == "commit"
and entry.get("path") and entry.get("sha")
}
def commit_date(repo: Repo, sha: str, cache_dir: str, offline: bool = False) -> str | None:
"""When a revision was committed, as the forge reports it (ISO 8601)."""
if repo.family == "gitlab":