forgejo/templates
oliverpool cb7ba8969d
fix: release page for empty or non-existing target (#24659)
Backport #24470

Fixes #24145

---

To solve the bug, I added a "computed" `TargetBehind` field to the
`Release` model, which indicates the target branch of a release. This is
particularly useful if the target branch was deleted in the meantime (or
is empty).

I also did a micro-optimization in `calReleaseNumCommitsBehind`. Instead
of checking that a branch exists and then call `GetBranchCommit`, I
immediately call `GetBranchCommit` and handle the `git.ErrNotExist`
error.

This optimization is covered by the added unit test.

_contributed in the context of @forgejo_
2023-05-12 14:14:41 -04:00
..
admin Convert .Source.SkipVerify to $cfg.SkipVerify (#23839) (#23899) 2023-04-03 13:02:28 -04:00
api/packages/pypi Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
base Don't set meta theme-color by default (#24340) (#24346) 2023-04-26 01:33:15 -04:00
code Fix 'View File' button in code search (#23478) (#23483) 2023-03-15 10:34:05 +01:00
custom Add footer extra links template (#9576) 2020-01-03 20:41:56 +02:00
explore Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) (#23791) 2023-03-30 09:09:22 -05:00
mail Revert relative links to absolute links in mail templates (#23267) (#23269) 2023-03-03 17:41:00 +00:00
org Fix Org edit page bugs: renaming detection, maxlength (#24161) (#24171) 2023-04-17 12:20:47 -04:00
package fix: do not escape space between PyPI repository url and package nameā€¦ (#23981) (#24008) 2023-04-08 23:13:43 +02:00
projects Add cardtype to org/user level project on creation, edit and view (#24043) (#24066) 2023-04-12 08:23:05 -04:00
repo fix: release page for empty or non-existing target (#24659) 2023-05-12 14:14:41 -04:00
shared Fix due date being wrong on issue list (#23475) (#23477) 2023-03-15 09:40:43 +08:00
status Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
swagger Fix typo in API route (#24310) (#24332) 2023-04-25 10:57:33 -04:00
user Remove row clicking from notification table (#22695) (#23706) 2023-03-26 01:21:40 +02:00
home.tmpl Add main landmark to templates and adjust titles (#22670) 2023-02-01 22:56:10 +00:00
install.tmpl Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
post-install.tmpl Fix various bugs for "install" page (#23194) (#23286) 2023-03-05 11:59:58 +01:00