mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 03:56:54 +00:00
Adding support for branches with a slash in them.
This commit is contained in:
parent
28c3288ba8
commit
878e45021d
2 changed files with 13 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ from pre_commit_hooks.util import cmd_output
|
|||
def is_on_branch(protected):
|
||||
branch = cmd_output('git', 'symbolic-ref', 'HEAD')
|
||||
chunks = branch.strip().split('/')
|
||||
return chunks[2] == protected
|
||||
return '/'.join(chunks[2:]) == protected
|
||||
|
||||
|
||||
def main(argv=[]):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue