Merge pull request #1549 from NixOS/feat/github-diffs

feat: Offload git diffs to GitHub
This commit is contained in:
Janne Heß
2026-01-05 13:10:00 +00:00
committed by GitHub

View File

@@ -347,6 +347,15 @@ BLOCK renderDiffUri;
url = res.0;
branch = res.1;
IF bi1.type == "hg" || bi1.type == "git" %]
[% IF url.substr(0, 19) == "https://github.com/" %]
<a target="_blank" [% HTML.attributes(href =>
url
_ "/compare/"
_ bi1.revision
_ "..."
_ bi2.revision,
) %]>[% HTML.escape(contents) %]</a>
[% ELSE %]
<a target="_blank" [% HTML.attributes(href => c.uri_for('/api/scmdiff', {
uri = url,
rev1 = bi1.revision,
@@ -354,6 +363,7 @@ BLOCK renderDiffUri;
type = bi1.type,
branch = branch
})) %]>[% HTML.escape(contents) %]</a>
[% END %]
[% ELSE;
contents;
END;