0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 08:45:04 +01:00
gitea/services/pull
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
..
check.go Fix misspelling of mergable (#30896) 2024-05-08 16:11:43 +00:00
check_test.go
comment.go
commit_status.go
commit_status_test.go
edits.go
lfs.go
main_test.go
merge.go Fix duplicate sub-path for avatars (#31365) 2024-06-15 11:43:57 +08:00
merge_ff_only.go
merge_merge.go
merge_prepare.go
merge_rebase.go
merge_squash.go
merge_test.go
patch.go Fix protected branch files detection on pre_receive hook (#31778) 2024-08-06 13:32:49 +00:00
patch_unmerged.go
pull.go Add permission check when creating PR (#31033) 2024-07-29 02:21:22 +00:00
pull_test.go
review.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-04-29 08:47:56 +00:00
review_test.go
temp_repo.go Make sure git version&feature are always prepared (#30877) 2024-05-06 18:34:16 +02:00
update.go Allow force push to protected branches (#28086) 2024-07-05 18:21:56 +00:00
update_rebase.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-04-29 08:47:56 +00:00