Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-24 10:46:10 +01:00
forgejo/tests
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
..
e2e Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
fuzz Move fuzz tests into tests/fuzz (#22376) 2023-01-09 15:30:14 +08:00
gitea-lfs-meta Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
gitea-repositories-meta Remove git sample files and ignore them (#24271) 2023-04-22 20:29:29 +08:00
integration fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
mssql.ini.tmpl Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
mysql.ini.tmpl Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
mysql8.ini.tmpl Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
pgsql.ini.tmpl Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
sqlite.ini.tmpl Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00
test_utils.go Rewrite queue (#24505) 2023-05-08 19:49:59 +08:00