0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-14 09:45:24 +01:00
gitea/routers/private
Lunny Xiao df7f1c2ead
Fix protected branch files detection on pre_receive hook (#31778)
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.
2024-08-06 13:32:49 +00:00
..
tests/repos
actions.go
default_branch.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
hook_post_receive_test.go
hook_post_receive.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
hook_pre_receive.go Fix protected branch files detection on pre_receive hook (#31778) 2024-08-06 13:32:49 +00:00
hook_proc_receive.go
hook_verification_test.go
hook_verification.go
internal_repo.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
internal.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
key.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
mail.go
main_test.go
manager_process.go
manager_unix.go
manager_windows.go
manager.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
restore_repo.go
serv.go Refactor names (#31405) 2024-06-19 06:32:45 +08:00
ssh_log.go