Description
Description
When a release is created via the API with an empty target
, the release page is a bit broken: https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.6.1
13 commits to since this release
The branch bame name is missing between "to" and "since" and the 0 commits
link points to a 404 (eg https://codeberg.org/forgejo-contrib/forgejo-helm/compare/v0.3.3...
).
This is related to #18226, which was fixed in #18252. The same "broken" logic is happening 50 lines below (.Target
is an empy string):
<a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.Target | PathEscapeSegments}}">
The same solution as in #18252 could be applied (stripping the ...
from the href
).
However I think it would be more useful to fall back to the repository default branch in such case (empty target
field).
I would be willing to make a PR for such a "default branch fallback" solution.
Moreover the count of commits is different between the release list and the single release (tag v0.5.0
for instance):
https://codeberg.org/forgejo-contrib/forgejo-helm/releases
https://codeberg.org/forgejo-contrib/forgejo-helm/releases/tag/v0.5.0
=> commit count fixed in #24148
Original report: https://codeberg.org/Codeberg/Community/issues/967
Related fix for a woodpecker plugin: https://codeberg.org/woodpecker-plugins/gitea-release/pulls/9
Gitea Version
1.19 and 1.20
Can you reproduce the bug on the Gitea demo site?
Yes
How are you running Gitea?
On codeberg
contributed in the context of @forgejo