aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-10-21 20:59:27 +0800
committerGitHub <noreply@github.com>2022-10-21 20:59:27 +0800
commit556e2d5506a4831f14e2b1c4508d9ec778fba628 (patch)
tree6c1a7d4aafd5cbc401789895a6683f8531a6c818 /templates
parent675c14aba660fcda7912519035a785e10ea61431 (diff)
downloadgitea-556e2d5506a4831f14e2b1c4508d9ec778fba628.tar.gz
gitea-556e2d5506a4831f14e2b1c4508d9ec778fba628.zip
Fix generating compare link (#21519) (#21530)
Fix #6318, backport #21519 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 18c02aa9ec..a24aa52247 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -68,7 +68,7 @@
<!-- If home page, show new PR. If not, show breadcrumb -->
{{if eq $n 0}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
- <a href="{{.BaseRepo.Link}}/compare/{{PathEscapeSegments .BaseRepo.DefaultBranch}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}{{if .BaseRepo.IsFork}}/{{PathEscape .Repository.Name}}{{end}}:{{end}}{{PathEscapeSegments .BranchName}}">
+ <a href="{{CompareLink .BaseRepo .Repository .BranchName}}">
<button id="new-pull-request" class="ui compact basic button tooltip" data-content="{{if .PullRequestCtx.Allowed}}{{.i18n.Tr "repo.pulls.compare_changes"}}{{else}}{{.i18n.Tr "action.compare_branch"}}{{end}}"><span class="text">{{svg "octicon-git-pull-request"}}</span></button>
</a>
{{end}}