Protect default branch against deletion (#11115)

Although default branch is not offered for deletion in the templates, we need to prevent it both at the router level and in the pre-receive hook.

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
6543 2020-05-06 13:08:45 +02:00 committed by GitHub
parent a1f11a05e9
commit 505e456f26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -1683,6 +1683,7 @@ branch.deleted_by = Deleted by %s
branch.restore_success = Branch '%s' has been restored.
branch.restore_failed = Failed to restore branch '%s'.
branch.protected_deletion_failed = Branch '%s' is protected. It cannot be deleted.
branch.default_deletion_failed = Branch '%s' is the default branch. It cannot be deleted.
branch.restore = Restore Branch '%s'
branch.download = Download Branch '%s'
branch.included_desc = This branch is part of the default branch