diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-10-21 16:39:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 16:39:26 +0800 |
commit | 16cbd5b59ccba3e418ba0c4c345eb2778ef1d15a (patch) | |
tree | 91cf3bdd9099e9dcbc7eee05ad5663942c11edfb /templates | |
parent | da3b657c455833f6732d811a410861dc8cfb1bc3 (diff) | |
download | gitea-16cbd5b59ccba3e418ba0c4c345eb2778ef1d15a.tar.gz gitea-16cbd5b59ccba3e418ba0c4c345eb2778ef1d15a.zip |
Fix generating compare link (#21519)
Fix #6318
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/home.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 39e58d8e0f..1e82d97944 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -70,7 +70,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}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}"><span class="text">{{svg "octicon-git-pull-request"}}</span></button> </a> {{end}} |