gitea/routers
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
..
api Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests (#26759) (#26806) 2023-08-30 02:25:34 -04:00
common Fix admin config page error, use tests to cover the admin config and 500 error page (#24965) 2023-05-29 15:00:21 +00:00
install Use docs.gitea.com instead of docs.gitea.io (#26769) 2023-08-28 19:58:16 +08:00
private Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-08-31 15:29:55 +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) (#26811) 2023-08-30 11:14:54 +00:00
init.go Refactor path & config system (#25330) (#25416) 2023-06-22 16:27:18 +00:00