fix(ui): /settings/lfs/find 500 error

When in the repository settings, visiting

- `LFS` to `/{owner}/{repo}/settings/lfs`
- `Find pointer files` to `/{owner}/{repo}/settings/lfs/pointers`
- `Find commits` to `/{owner}/{repo}/settings/lfs/find?oid=...`

failed with an error 500 because of an incorrect evaluation of the
template.

Regression introduced by
cbf923e87b

A test is added to visit the page and guard against future
regressions.

Refs: https://codeberg.org/forgejo/forgejo/issues/3438
This commit is contained in:
Earl Warren 2024-04-25 16:23:12 +02:00
parent 7624b78544
commit 078229a5e4
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 26 additions and 4 deletions

View file

@ -23,9 +23,9 @@
<span class="text grey">{{svg "octicon-git-branch"}}{{.BranchName}}</span>
</td>
<td>
{{if .ParentHashes}}
{{if .ParentIDs}}
{{ctx.Locale.Tr "repo.diff.parent"}}
{{range .ParentHashes}}
{{range .ParentIDs}}
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">{{ShortSha .String}}</a>
{{end}}
{{end}}