1
1
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-30 12:31:29 +02:00
gitea/models
CaiCandong 815d267c80
Fix verifyCommits error when push a new branch (#26664)
> ### 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: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-08-30 02:27:53 +00:00
..
actions chore(actions): support cron schedule task (#26655) 2023-08-24 03:06:51 +00:00
activities Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) 2023-08-07 12:23:59 +02:00
admin
asymkey Update tool dependencies, lock govulncheck and actionlint (#25655) 2023-07-09 11:58:06 +00:00
auth Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597) 2023-08-21 12:15:55 +08:00
avatars
db Fix NuGet search endpoints (#25613) 2023-08-14 02:50:55 +00:00
dbfs
fixtures Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
git Add link to job details and tooltip to commit status in repo list in dashboard (#26326) 2023-08-21 15:26:10 +08:00
issues Add member, collaborator, contributor, and first-time contributor roles and tooltips (#26658) 2023-08-24 13:06:17 +08:00
migrations Replace deprecated elliptic.Marshal (#26800) 2023-08-29 22:19:40 +02:00
organization Remove unused code (#25734) 2023-07-06 21:52:41 +00:00
packages Fix NuGet search endpoints (#25613) 2023-08-14 02:50:55 +00:00
perm
project Refactor project templates (#26448) 2023-08-12 10:30:28 +00:00
pull
repo Move modules/mirror to services (#26737) 2023-08-27 10:24:45 +08:00
secret feat(API): add route and implementation for creating/updating repository secret (#26766) 2023-08-29 20:54:49 +00:00
shared/types
system
unit
unittest
user Fix API leaking Usermail if not logged in (#25097) 2023-07-31 01:18:38 +00:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate_test.go Add context parameter to some database functions (#26055) 2023-07-22 22:14:27 +08:00
migrate.go Add context parameter to some database functions (#26055) 2023-07-22 22:14:27 +08:00
org_team_test.go
org_team.go
org_test.go
org.go
repo_collaboration_test.go
repo_collaboration.go
repo_test.go
repo_transfer_test.go
repo_transfer.go
repo.go chore(actions): support cron schedule task (#26655) 2023-08-24 03:06:51 +00:00