1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-09 17:24:43 +00:00
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
..
2022-09-20 15:59:20 +08:00
2017-04-21 19:32:31 +08:00
2022-09-20 15:59:20 +08:00
2023-08-14 11:56:14 +02:00
2020-08-16 23:07:38 -04:00
2019-12-15 08:11:31 +00:00
2019-12-07 17:04:19 -05:00
2019-12-11 23:23:05 -05:00
2023-03-10 08:28:32 -06:00