gitea/routers
Giteabot 8d11946d67
Fix protected branch files detection on pre_receive hook (#31778) (#31796)
Backport #31778 by @lunny

Fix #31738

When pushing a new branch, the old commit is zero. Most git commands
cannot recognize the zero commit id. To get the changed files in the
push, we need to get the first diverge commit of this branch. In most
situations, we could check commits one by one until one commit is
contained by another branch. Then we will think that commit is the
diverge point.

And in a pre-receive hook, this will be more difficult because all
commits haven't been merged and they actually stored in a temporary
place by git. So we need to bring some envs to let git know the commit
exist.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-08-08 03:08:30 +00:00
..
api Set owner id to zero when GetRegistrationToken for repo (#31725) (#31729) 2024-07-30 09:57:43 +08:00
common Fix missing images in editor preview due to wrong links (#31299) (#31393) 2024-06-17 15:07:21 +08:00
install Always load or generate oauth2 jwt secret (#30942) (#30978) 2024-05-14 15:00:38 +00:00
private Fix protected branch files detection on pre_receive hook (#31778) (#31796) 2024-08-08 03:08:30 +00:00
utils Refactor external URL detection (#29973) 2024-03-22 04:32:40 +08:00
web Fix wiki revision pagination (#31760) (#31772) 2024-08-04 10:45:41 +08:00
init.go Make sure git version&feature are always prepared (#30877) (#30879) 2024-05-07 02:07:33 +00:00