gitea/models
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 Support upload outputs and use needs context on Actions (#24230) 2023-04-22 16:12:41 -04:00
activities
admin
asymkey Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
auth
avatars
db Improve milestone filter on issues page (#22423) 2023-04-30 09:12:49 -04:00
dbfs Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
fixtures fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
git Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
issues Refresh the refernce of the closed PR when reopening (#24231) 2023-05-08 14:39:32 +08:00
migrations Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
organization Add owner team permission check test (#24096) 2023-04-19 19:19:13 -04:00
packages Add RPM registry (#23380) 2023-05-05 20:33:37 +00:00
perm
project
pull
repo fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
secret
system
unit Require at least one unit to be enabled (#24189) 2023-05-06 17:39:06 +08:00
unittest Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
user Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
webhook Fix incorrect webhook time and use relative-time to display it (#24477) 2023-05-03 19:53:43 -04:00
error.go
fixture_generation.go
fixture_test.go
main_test.go Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
migrate_test.go
migrate.go
org_team_test.go
org_team.go Remove org users who belong to no teams (#24247) 2023-04-24 15:52:38 -04:00
org_test.go
org.go
repo_collaboration_test.go
repo_collaboration.go
repo_test.go
repo_transfer_test.go
repo_transfer.go Fix unclear IsRepositoryExist logic (#24374) 2023-04-28 14:14:26 -04:00
repo.go Split "modules/context.go" to separate files (#24569) 2023-05-08 17:36:54 +08:00