0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-19 04:16:53 -05:00
forgejo/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>
2023-08-31 15:29:55 +00:00
..
actions Fix log typo in task.go (#26337) (#26343) 2023-08-05 10:15:49 +00:00
activities Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368) 2023-08-07 10:55:25 +00:00
admin Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
asymkey Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
auth Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) (#26618) 2023-08-21 14:19:43 +08:00
avatars
db Fix NuGet search endpoints (#25613) (#26499) 2023-08-16 06:01:20 +00:00
dbfs Fix content holes in Actions task logs file (#25560) (#25566) 2023-06-28 23:39:23 +00:00
fixtures Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-08-31 15:29:55 +00:00
git Fix pull request check list is limited (#26179) (#26245) 2023-07-31 08:56:46 +00:00
issues Fix project filter bugs (#26490) (#26558) 2023-08-19 12:21:45 +02:00
migrations Prevent primary key update on migration (#26192) (#26199) 2023-07-28 11:08:11 +02:00
organization Remove unused code (#25734) (#25788) 2023-07-09 19:47:58 +00:00
packages Fix NuGet search endpoints (#25613) (#26499) 2023-08-16 06:01:20 +00:00
perm
project Update xorm version (#26128) (#26150) 2023-07-26 07:40:23 +00:00
pull
repo Fix the topic validation rule and suport dots (#26286) (#26303) 2023-08-04 13:00:49 +08:00
secret
shared/types
system Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
unit
unittest Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
user check blocklist for emails when adding them to account (#26812) (#26831) 2023-08-31 00:52:19 +00:00
webhook Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate.go
migrate_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
repo_collaboration.go
repo_collaboration_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go