-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Internal Server Error on push (GetAffectedFiles()) #31738
Comments
I have got the same trouble when I tried to push by ssh.
The version of gitea I used is 1.22.1 |
OMG, I have solved my trouble.
Maybe just because the user git has no rights to write in the data directory.
But I have to use port 2222 instead of 22 now |
Good news! sudo setcap 'cap_net_bind_service=+ep' /PATH_TO_GITEA/gitea
./gitea web With having run these as git, the trouble I met has got gone. |
Glad for you 👍 Unfortunately this has nothing in common with branch protection and |
I cannot reproduce this on main branch according to your steps.
Take a look at source |
I was pushing a new branch, maybe this is the key difference. |
Could you paste demo site's repository URL here? |
Repo: https://demo.gitea.com/f403/GetAffectedFiles-test2 Error:
|
Pushing to a new branch can reproduce it but not pushing to main branch. |
) Fix go-gitea#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.
…1796) 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 <[email protected]>
Description
I was testing how branch protection works and if it is possible to protect modification of
.gitea/actions
from being modified in a PR. As far as I understand, Gitea is executing actions code from a PR, and not frommain
, but this must be another issue.Here is the following bug.
If branch protection is set for branch
*
all pushes to new branches will fail with "Gitea: Internal Server Error (no message for end users)
"How to reproduce:
*
, set protected files to.gitea/**;mkdocs.yml;mkdocs.yaml
, push -Enable Push
(Without protected files it works - this is how a new branch was created on demo.gitea)
gitea.log
has following entries (hashes are differ from example above):Gitea Version
1.21.11
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Docker, but it can be reproduced on demo.gitea.com
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: