1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

refactor improve NoBetterThan (#26126)

- The `NoBetterThan` function can only handle comparisons between
"pending," "success," "error," and "failure." For any other comparison,
we directly return false. This prevents logic errors like the one in
#26121.
- The callers of the `NoBetterThan` function should also avoid making
incomparable calls.

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: puni9869 <80308335+puni9869@users.noreply.github.com>
This commit is contained in:
caicandong
2023-07-26 16:52:07 +08:00
committed by GitHub
parent df9afe3aa8
commit 13359581df
4 changed files with 193 additions and 8 deletions

View File

@@ -16514,7 +16514,7 @@
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"CommitStatusState": {
"description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"",
"description": "CommitStatusState holds the state of a CommitStatus\nIt can be \"pending\", \"success\", \"error\" and \"failure\"",
"type": "string",
"x-go-package": "code.gitea.io/gitea/modules/structs"
},