mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-26 02:50:54 +00:00
fix: make branch protection work for new branches
- If `GetAffectedFiles` is called for a push with an empty oldCommitID, then set the oldCommitID to the empty tree. This will effictively diff all the changes included in the push, which is the expected behavior for branches. - Integration test added. - Resolves #5683 - Port of gitea#31778 but implemented differently.
This commit is contained in:
parent
0f99a0e3c0
commit
f5e025917f
3 changed files with 35 additions and 0 deletions
|
@ -131,6 +131,8 @@ var ignoredErrorMessage = []string{
|
|||
`:SSHLog() [E] ssh: Not allowed to push to protected branch protected. HookPreReceive(last) failed: internal API error response, status=403`,
|
||||
// TestGit/HTTP/BranchProtectMerge
|
||||
`:SSHLog() [E] ssh: branch protected is protected from force push. HookPreReceive(last) failed: internal API error response, status=403`,
|
||||
// TestGit/HTTP/BranchProtect
|
||||
`:SSHLog() [E] ssh: branch before-create-2 is protected from changing file protected-file-data-`,
|
||||
// TestGit/HTTP/MergeFork/CreatePRAndMerge
|
||||
`:DeleteBranchPost() [E] DeleteBranch: GetBranch: branch does not exist [repo_id: 1099 name: user2:master]`, // sqlite
|
||||
"s/web/repo/branch.go:108:DeleteBranchPost() [E] DeleteBranch: GetBranch: branch does not exist [repo_id: 10000 name: user2:master]", // mysql
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue