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/models
Giteabot 93c36f395c
Fix verifyCommits error when push a new branch (#26664) (#26810)
Backport #26664 by @CaiCandong

> ### 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 #25565
Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting
an valid solution!

Co-authored-by: CaiCandong <50507092+CaiCandong@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
..
actions Fix log typo in task.go (#26337) (#26343) 2 years ago
activities Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) 2 years ago
admin Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
asymkey Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
auth Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) 2 years ago
avatars Avoid warning for system setting when start up (#23054) 2 years ago
db Fix NuGet search endpoints (#25613) (#26499) 2 years ago
dbfs Fix content holes in Actions task logs file (#25560) (#25566) 2 years ago
fixtures Fix verifyCommits error when push a new branch (#26664) (#26810) 2 years ago
git Fix pull request check list is limited (#26179) (#26245) 2 years ago
issues Fix project filter bugs (#26490) (#26558) 2 years ago
migrations Prevent primary key update on migration (#26192) (#26199) 2 years ago
organization Remove unused code (#25734) (#25788) 2 years ago
packages Fix NuGet search endpoints (#25613) (#26499) 2 years ago
perm Rewrite logger system (#24726) 2 years ago
project Update xorm version (#26128) (#26150) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo Fix the topic validation rule and suport dots (#26286) (#26303) 2 years ago
secret Respect original content when creating secrets (#24745) 2 years ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2 years ago
system Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
unit Rewrite logger system (#24726) 2 years ago
unittest Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
user check blocklist for emails when adding them to account (#26812) (#26831) 2 years ago
webhook Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 2 years ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Remove org users who belong to no teams (#24247) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Replace `interface{}` with `any` (#25686) (#25687) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Fix unclear `IsRepositoryExist` logic (#24374) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago