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

Force push seems doesn't work on protected branch with white list enabled #4914

Closed
2 of 7 tasks
gigi206 opened this issue Sep 11, 2018 · 3 comments
Closed
2 of 7 tasks
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@gigi206
Copy link

gigi206 commented Sep 11, 2018

  • Gitea version (or commit ref): 1.5.1
  • Git version:
  • Operating system: SLES12 SP3
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:

Description

I activated protected branch with white list access :
protected branch

When I force push, I have the following message :

remote: Gitea: branch master is protected from force push        
To https://try.gitea.io/gigix/test.git
 ! [remote rejected] 4e308e02f18c0a51c687b32ff9699949e16204c4 -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://try.gitea.io/gigix/test.git'

error

Is there an issue with withite list on protected branch ?

@lafriks
Copy link
Member

lafriks commented Sep 11, 2018

I think it is intended behaviour. Without whitelist you can not even commit to that branch only use PRs

@SagePtr
Copy link
Contributor

SagePtr commented Sep 11, 2018

Whitelist allows certain users regular pushes, it does not allow force pushes.
Prevoiusly protected branch push whitelist allowed wide range of operation, even branch deletion, but this was fixed in #4607 and now it does allow what is said in the description.

@gigi206
Copy link
Author

gigi206 commented Sep 11, 2018

Thank you for your reply.

If I need to enable merge whitelist, I must enable Branch protection.

Branch protection can be done by custom Git scripts hook. But if I want to code custom Git scripts hook for activate protected branch with force push then I can't enable merge whitelist without activated branch protection.

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Sep 12, 2018
@lunny lunny closed this as completed Sep 12, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

4 participants