From 411dcb685b8b73994ff77ec308e6d9b537155da3 Mon Sep 17 00:00:00 2001 From: Tom Clark Date: Tue, 28 Jul 2020 10:46:07 +0100 Subject: [PATCH] Retrieve branch name as ascii, not bytes --- pre_commit_hooks/check_branch_name.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit_hooks/check_branch_name.py b/pre_commit_hooks/check_branch_name.py index 69aa460..3a581fb 100755 --- a/pre_commit_hooks/check_branch_name.py +++ b/pre_commit_hooks/check_branch_name.py @@ -16,7 +16,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int: help='Valid regexes for a branch name', ) - current_branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) + current_branch_name = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('ascii').strip() args = parser.parse_args(argv) for regexp in args.regexes: