forgejo/templates/repo
oliverpool 8030614386
fix: release page for empty or non-existing target (#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.
2023-05-10 11:43:55 +08:00
..
actions
branch
cite
diff
editor
find
graph
issue
migrate
projects
pulls
release
settings
tag
wiki
activity.tmpl
blame.tmpl
branch_dropdown.tmpl
clone_buttons.tmpl
clone_script.tmpl
commit_page.tmpl
commit_status.tmpl
commit_statuses.tmpl
commits.tmpl
commits_list.tmpl
commits_list_small.tmpl
commits_table.tmpl
create.tmpl
create_helper.tmpl
empty.tmpl
file_info.tmpl
forks.tmpl
graph.tmpl
header.tmpl
home.tmpl
icon.tmpl
packages.tmpl
search.tmpl
search_name.tmpl
shabox_badge.tmpl
sub_menu.tmpl
sub_menu_release_tag.tmpl
unicode_escape_prompt.tmpl
upload.tmpl
user_cards.tmpl
view_file.tmpl
view_list.tmpl
watchers.tmpl