Skip to content

Commit 61c9268

Browse files
authored
Fix wrong usage of PathEscapeSegments in branch list page (#25864)
Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/21ce7bfa-36f7-4125-9a66-d644400916a8) emmm, don't know how to write a good title to describe this issue. If you have a good idea, I can change the title. The fix code is copied from L122. Not sure it is right or not. @lunny Maybe `DefaultBranchBranch` is also typo? Two `Branch` in variable name .
1 parent 4628aa5 commit 61c9268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/repo/branch/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
{{end}}
126126
{{else if and .LatestPullRequest.HasMerged .MergeMovedOn}}
127127
{{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}}
128-
<a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | PathEscapeSegments}}">
128+
<a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}">
129129
<button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{$.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{$.locale.Tr "action.compare_branch"}}{{end}}</button>
130130
</a>
131131
{{end}}

0 commit comments

Comments
 (0)