forgejo/routers/web/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
setting
activity.go
attachment.go
blame.go
branch.go
cherry_pick.go
commit.go
compare.go
download.go
editor.go
editor_test.go
find.go
helper.go
helper_test.go
http.go
http_test.go
issue.go
issue_content_history.go
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
lfs.go
main_test.go
middlewares.go
migrate.go
milestone.go
packages.go
patch.go
projects.go
projects_test.go
pull.go
pull_review.go
release.go
release_test.go
render.go
repo.go
search.go
setting.go
setting_protected_branch.go
settings_test.go
tag.go
topic.go
treelist.go
view.go
view_test.go
webhook.go Move secrets and runners settings to actions settings (#24200) 2023-04-27 20:08:47 -04:00
wiki.go
wiki_test.go