You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/tests
oliverpool cb7ba8969d
fix: release page for empty or non-existing target (#24659)
Backport #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.

_contributed in the context of @forgejo_
2 years ago
..
e2e Implement FSFE REUSE for golang files (#21840) 2 years ago
fuzz Move fuzz tests into tests/fuzz (#22376) 2 years ago
gitea-lfs-meta Test views of LFS files (#22196) 2 years ago
gitea-repositories-meta fix calReleaseNumCommitsBehind (#24148) (#24197) 2 years ago
integration fix: release page for empty or non-existing target (#24659) 2 years ago
mssql.ini.tmpl Kd/ci playwright go test (#20123) 3 years ago
mysql.ini.tmpl Make minio package support legacy MD5 checksum (#23768) (#23770) 2 years ago
mysql8.ini.tmpl Kd/ci playwright go test (#20123) 3 years ago
pgsql.ini.tmpl Kd/ci playwright go test (#20123) 3 years ago
sqlite.ini.tmpl Add a simple test for external renderer (#20033) 2 years ago
test_utils.go Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) 2 years ago
testlogger.go Implement FSFE REUSE for golang files (#21840) 2 years ago