]> source.dussan.org Git - gitea.git/commitdiff
remove unused call to $.HeadRepo in view_title template (#32317)
authorRowan Bohde <rowan.bohde@gmail.com>
Wed, 30 Oct 2024 05:12:48 +0000 (00:12 -0500)
committerGitHub <noreply@github.com>
Wed, 30 Oct 2024 05:12:48 +0000 (13:12 +0800)
This is only populated in
[`ParseCompareInfo`](https://github.com/search?q=repo%3Ago-gitea%2Fgitea%20%20.Data%5B%22HeadRepo%22%5D&type=code)
which is called in two handlers:

*
[`CompareAndPullRequestPost`](https://github.com/go-gitea/gitea/blob/9206fbb55fd28f21720072fce6a36cc22277934c/routers/web/repo/pull.go#L1246)
- a JSON post handler that doesn't render templates
*
[`CompareDiff`](https://github.com/go-gitea/gitea/blob/9206fbb55fd28f21720072fce6a36cc22277934c/routers/web/repo/compare.go#L706)
- which can render `diff/box.tmpl` and `diff/compare.tmpl`

templates/repo/issue/view_title.tmpl

index 7fa77b3f1cf334de7e49075a0994fcfd2332741f..1591c2cadfb50a98b76fefa70d8e5f67686d36d3 100644 (file)
                                                                                {{$sameBase := ne $.BaseName $.HeadUserName}}
                                                                                {{$differentBranch := ne . $.HeadBranch}}
                                                                                {{if or $sameBase $differentBranch}}
-                                                                                       <div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}{{if $.HeadRepo}}/{{$.HeadRepo}}{{end}}:{{.}}</div>
+                                                                                       <div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-branch="{{.}}">{{$.BaseName}}:{{.}}</div>
                                                                                {{end}}
                                                                        {{end}}
                                                                </div>