mirror of https://github.com/go-gitea/gitea.git
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.
7a687caca4
Before:
![image](https://github.com/go-gitea/gitea/assets/18380374/8c5643b5-5c16-4674-9fe6-9e7fa2dda0b9)
After:
![image](https://github.com/go-gitea/gitea/assets/18380374/caf8891b-14df-418d-a7eb-977b54b9e9be)
There's a bug in the recent logic, `CalcCommitStatus` will always return
the first item of `statuses` or error status, because `state` is defined
with default value which should be `CommitStatusSuccess`
Then
``` golang
if status.State.NoBetterThan(state) {
```
this `if` will always return false unless `status.State =
CommitStatusError` which makes no sense.
So `lastStatus` will always be `nil` or error status.
Then we will always return the first item of `statuses` here or only
return error status, and this is why in the first picture the commit
status is `Success` but not `Failure`.
|
2 years ago | |
---|---|---|
.. | ||
branch.go | 2 years ago | |
branch_list.go | 2 years ago | |
branch_test.go | 2 years ago | |
commit_status.go | 2 years ago | |
commit_status_test.go | 2 years ago | |
lfs.go | 2 years ago | |
lfs_lock.go | 2 years ago | |
main_test.go | 2 years ago | |
protected_banch_list_test.go | 2 years ago | |
protected_branch.go | 2 years ago | |
protected_branch_list.go | 2 years ago | |
protected_branch_test.go | 2 years ago | |
protected_tag.go | 2 years ago | |
protected_tag_test.go | 2 years ago |