1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00
forgejo/routers/private/tests/repos/repo1_hook_verification/objects
Giteabot 193e04c43b
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>
(cherry picked from commit 93c36f395c)
2023-09-08 08:09:18 +02:00
..
0b Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
2b Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
08 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
8b Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
9c Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
13 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
23 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
65 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
72 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
93 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
97 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
a9 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
ba Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
bb Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
cb Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
d7 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
e3 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
e6 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
e8 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
info Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00
tmp_objdir-incoming-a21648 Fix verifyCommits error when push a new branch (#26664) (#26810) 2023-09-08 08:09:18 +02:00