Adding support for branches with a slash in them.

This commit is contained in:
Evan J. Felix 2017-03-20 09:40:55 -07:00
parent 28c3288ba8
commit 878e45021d
2 changed files with 13 additions and 1 deletions

View file

@ -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=[]):