mirror of
1
Fork 0
forgejo/routers
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
..
api Filter get single commit (#24613) 2023-05-10 09:34:07 +08:00
common Make repository response support HTTP range request (#24592) 2023-05-09 15:34:36 +08:00
install Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
private Refactor web route (#24080) 2023-04-20 14:49:06 -04:00
utils Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web fix: release page for empty or non-existing target (#24470) 2023-05-10 11:43:55 +08:00
init.go Use globally shared HTMLRender (#24436) 2023-04-30 08:22:23 -04:00