Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A protected branch cannot be created from a normal branch when the protection rule includes specific file protections. #33265

Open
Flint01686 opened this issue Jan 14, 2025 · 0 comments · May be fixed by #33298
Labels

Comments

@Flint01686
Copy link

Flint01686 commented Jan 14, 2025

Description

I've encountered a non-critical but illogical issue that manifests as unexpected behavior. I have a rule for the customer/ prefix that protects the core folder (details are in the screenshots). When I try to create a branch with the customer/ prefix from the master branch (which has no protections), I receive an error. The error is shown in the screenshots, and the root cause can be seen in the server logs. It looks like this:
2025/01/14 13:54:42 .../hook_pre_receive.go:235:preReceiveBranch() [E] Unable to check file protection for commits from 0000000000000000000000000000000000000000 to 6ca0e381b177e3577f62ec9a03df8a00acb0b165 in <Repository 2:compname/reponame>: cannot find the start commit of 6ca0e381b177e3577f62ec9a03df8a00acb0b165
2025/01/14 13:54:42 ...eb/routing/logger.go:102:func1() [I] router: completed POST /api/internal/hook/pre-receive/compname/reponame for 127.0.0.1:0, 500 Internal Server Error in 52.7ms @ private/hook_pre_receive.go:105(private.HookPreReceive)

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

изображение
изображение
изображение

Git Version

2.42.0.windows.2

Operating System

Windows 11

How are you running Gitea?

Use exe for win from official gitea site

Database

PostgreSQL

@Zettat123 Zettat123 linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant