gitea/models
CaiCandong 815d267c80
Fix verifyCommits error when push a new branch ()
> ### Description
> If a new branch is pushed, and the repository has a rule that would
require signed commits for the new branch, the commit is rejected with a
500 error regardless of whether it's signed.
> 
> When pushing a new branch, the "old" commit is the empty ID
(0000000000000000000000000000000000000000). verifyCommits has no
provision for this and passes an invalid commit range to git rev-list.
Prior to 1.19 this wasn't an issue because only pre-existing individual
branches could be protected.
> 
> I was able to reproduce with
[try.gitea.io/CraigTest/test](https://try.gitea.io/CraigTest/test),
which is set up with a blanket rule to require commits on all branches.


Fix 
Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting
an valid solution!

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
..
actions chore(actions): support cron schedule task ()
activities Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex ()
admin Replace `interface{}` with `any` ()
asymkey Update tool dependencies, lock govulncheck and actionlint ()
auth Ignore the trailing slashes when comparing oauth2 redirect_uri ()
avatars Avoid warning for system setting when start up ()
db Fix NuGet search endpoints ()
dbfs Fix content holes in Actions task logs file ()
fixtures Fix verifyCommits error when push a new branch ()
git Add link to job details and tooltip to commit status in repo list in dashboard ()
issues Add `member`, `collaborator`, `contributor`, and `first-time contributor` roles and tooltips ()
migrations Replace deprecated `elliptic.Marshal` ()
organization Remove unused code ()
packages Fix NuGet search endpoints ()
perm some less naked returns ()
project Refactor project templates ()
pull refactor some functions to support ctx as first parameter ()
repo Move `modules/mirror` to `services` ()
secret feat(API): add route and implementation for creating/updating repository secret ()
shared/types Display owner of a runner as a tooltip instead of static text ()
system Replace `interface{}` with `any` ()
unit Rewrite logger system ()
unittest Replace `interface{}` with `any` ()
user Fix API leaking Usermail if not logged in ()
webhook Replace `interface{}` with `any` ()
error.go Sync branches into databases ()
fixture_generation.go Implement FSFE REUSE for golang files ()
fixture_test.go Implement FSFE REUSE for golang files ()
main_test.go Merge setting.InitXXX into one function with options ()
migrate.go Add context parameter to some database functions ()
migrate_test.go Add context parameter to some database functions ()
org.go refactor some functions to support ctx as first parameter ()
org_team.go Remove org users who belong to no teams ()
org_team_test.go Implement FSFE REUSE for golang files ()
org_test.go Implement FSFE REUSE for golang files ()
repo.go chore(actions): support cron schedule task ()
repo_collaboration.go refactor some functions to support ctx as first parameter ()
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` ()
repo_test.go Implement FSFE REUSE for golang files ()
repo_transfer.go Fix unclear `IsRepositoryExist` logic ()
repo_transfer_test.go Rename almost all Ctx functions ()