Add wildcard matching to no-commit-to-branch hook so that commits can

be blocked on, for example, all release branches with 'release/*'
This commit is contained in:
Marc Jay 2019-04-09 23:53:39 +01:00
parent aa9c202b9b
commit d6847c4827
3 changed files with 19 additions and 4 deletions

View file

@ -79,7 +79,7 @@ Add this to your `.pre-commit-config.yaml`
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
- Use `args: ['--django']` to match `test*.py` instead.
- `no-commit-to-branch` - Protect specific branches from direct checkins.
- Use `args: [--branch, staging, --branch, master]` to set the branch.
- Use `args: [--branch, staging, --branch, master, --branch, release/*]` to set the branch.
`master` is the default if no argument is set.
- `-b` / `--branch` may be specified multiple times to protect multiple
branches.