Merge pull request #1549 from NixOS/feat/github-diffs
feat: Offload git diffs to GitHub
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user