forgejo/routers/private
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
..
tests/repos Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
actions.go parseScope with owner/repo always sets owner to zero (#25987) 2023-07-19 21:21:51 +08:00
default_branch.go
hook_post_receive.go Use the type RefName for all the needed places and fix pull mirror sync bugs (#24634) 2023-05-26 01:04:48 +00:00
hook_pre_receive.go Add context parameter to some database functions (#26055) 2023-07-22 22:14:27 +08:00
hook_proc_receive.go
hook_verification.go Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
hook_verification_test.go Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
internal.go
internal_repo.go
key.go
mail.go
main_test.go Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
manager.go Fix logger refactoring regression: manager logging add (#24847) 2023-05-24 08:09:33 +08:00
manager_process.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
manager_unix.go
manager_windows.go
restore_repo.go
serv.go
ssh_log.go