From cbe44543cf54dd57c1196e73a322f072387da7e2 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 17 Jan 2022 20:22:52 +0100 Subject: [PATCH 1/2] Fix commit links on compare page - Use the correct repo link for each commit(the headrepo). As for compare pages were baserepo != headrepo, it wouldn't have the correct link. --- templates/repo/commits_list.tmpl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index ad2e825e23bd..ad3f20db31bf 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -10,6 +10,7 @@ {{range .Commits}} + {{$commitRepoLink := $.HeadRepo.Link}} {{$userName := .Author.Name}} @@ -41,9 +42,9 @@ {{end}} {{end}} {{if $.PageIsWiki}} - + {{else if $.Reponame}} - + {{else}} {{end}} @@ -62,8 +63,8 @@ {{if $.PageIsWiki}} {{.Summary | RenderEmoji}} {{else }} - {{ $commitLink:= printf "%s/commit/%s" $.RepoLink (PathEscape .ID.String) }} - {{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{ $commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String) }} + {{RenderCommitMessageLinkSubject .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}} {{end}} {{if IsMultilineCommitMessage .Message}} @@ -71,7 +72,7 @@ {{end}} {{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $}} {{if IsMultilineCommitMessage .Message}} - + {{end}} {{TimeSince .Author.When $.Lang}} From c1090adf7c23f2ba8ff46f7637916be6a7a4fb49 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Tue, 18 Jan 2022 12:52:33 +0000 Subject: [PATCH 2/2] Prefer CommitRepoLink, then HeadRepo then RepoLink for commits Signed-off-by: Andrew Thornton --- templates/repo/commits_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index ad3f20db31bf..d43170e525cc 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -9,8 +9,8 @@ + {{$commitRepoLink := $.RepoLink}}{{if $.CommitRepoLink}}{{$commitRepoLink = $.CommitRepoLink}}{{end}} {{range .Commits}} - {{$commitRepoLink := $.HeadRepo.Link}} {{$userName := .Author.Name}}