loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix "Updating branch by merge" bug in "update_branch_by_merge.tmpl" (#23790)

Fix regression of #22683 , it didn't pass all variables into
sub-template.

Close #23787

After the fix, all links and the form are correct.


![image](https://user-images.githubusercontent.com/2114189/228511037-580b5f5d-43e7-494f-9b66-89f9f908e208.png)


![image](https://user-images.githubusercontent.com/2114189/228510958-f960284a-101d-4b0e-b887-80033127898d.png)

authored by

wxiaoguang and committed by
GitHub
ffd22697 c09eab54

+11 -13
+2 -3
templates/repo/issue/view_content/pull.tmpl
··· 128 128 {{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a> 129 129 <div class="content"> 130 130 {{template "repo/pulls/status" .}} 131 - {{$canAutoMerge := false}} 132 131 {{$showGeneralMergeForm := false}} 133 132 <div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}"> 134 133 {{if .Issue.PullRequest.HasMerged}} ··· 193 192 {{end}} 194 193 </div> 195 194 </div> 196 - {{template "repo/issue/view_content/update_branch_by_merge" (dict "locale" .locale "Issue" .Issue "UpdateAllowed" .UpdateAllowed "UpdateByRebaseAllowed" .UpdateByRebaseAllowed "Link" .Link)}} 195 + {{template "repo/issue/view_content/update_branch_by_merge" $}} 197 196 {{else if .Issue.PullRequest.IsChecking}} 198 197 <div class="item"> 199 198 <i class="icon icon-octicon">{{svg "octicon-sync"}}</i> ··· 286 285 </div> 287 286 {{end}} 288 287 {{end}} 289 - {{template "repo/issue/view_content/update_branch_by_merge" (dict "locale" .locale "Issue" .Issue "UpdateAllowed" .UpdateAllowed "UpdateByRebaseAllowed" .UpdateByRebaseAllowed "Link" .Link)}} 288 + {{template "repo/issue/view_content/update_branch_by_merge" $}} 290 289 {{if .Issue.PullRequest.IsEmpty}} 291 290 <div class="ui divider"></div> 292 291
+9 -10
templates/repo/issue/view_content/update_branch_by_merge.tmpl
··· 1 - {{$canAutoMerge := false}} 2 - {{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}} 1 + {{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}} 3 2 <div class="ui divider"></div> 4 3 <div class="item item-section"> 5 4 <div class="item-section-left"> ··· 7 6 {{$.locale.Tr "repo.pulls.outdated_with_base_branch"}} 8 7 </div> 9 8 <div class="item-section-right"> 10 - {{if and .UpdateAllowed .UpdateByRebaseAllowed}} 9 + {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} 11 10 <div class="gt-dib"> 12 11 <div class="ui buttons update-button"> 13 - <button class="ui button" data-do="{{.Link}}/update" data-redirect="{{.Link}}"> 12 + <button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}"> 14 13 <span class="button-text"> 15 14 {{$.locale.Tr "repo.pulls.update_branch"}} 16 15 </span> ··· 19 18 <div class="ui dropdown icon button no-text"> 20 19 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 21 20 <div class="menu"> 22 - <a class="item active selected" data-do="{{.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a> 23 - <a class="item" data-do="{{.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a> 21 + <a class="item active selected" data-do="{{$.Link}}/update">{{$.locale.Tr "repo.pulls.update_branch"}}</a> 22 + <a class="item" data-do="{{$.Link}}/update?style=rebase">{{$.locale.Tr "repo.pulls.update_branch_rebase"}}</a> 24 23 </div> 25 24 </div> 26 25 </div> 27 26 </div> 28 27 {{end}} 29 - {{if and .UpdateAllowed (not .UpdateByRebaseAllowed)}} 30 - <form action="{{.Link}}/update" method="post" class="ui update-branch-form"> 31 - {{.CsrfTokenHtml}} 32 - <button class="ui compact button" data-do="update"> 28 + {{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}} 29 + <form action="{{$.Link}}/update" method="post" class="ui update-branch-form"> 30 + {{$.CsrfTokenHtml}} 31 + <button class="ui compact button"> 33 32 <span class="ui text">{{$.locale.Tr "repo.pulls.update_branch"}}</span> 34 33 </button> 35 34 </form>