1
0
Fork 0
forgejo/routers
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
..
api Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) 2023-08-29 22:13:16 +00:00
common Start using template context function (#26254) 2023-08-08 01:22:47 +00:00
install Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
private Fix verifyCommits error when push a new branch (#26664) 2023-08-30 02:27:53 +00:00
utils Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web Fix context filter has no effect in dashboard (#26695) 2023-08-29 12:46:52 +00:00
init.go Pre-register OAuth2 applications for git credential helpers (#26291) 2023-08-09 14:24:07 +02:00