Remove unused try catch

Since return code from cmd_output is ignored the try catch can be ignored.
This commit is contained in:
David Paz 2022-07-17 11:33:21 +02:00
parent e7acd0dcf2
commit 3575cf7c02
No known key found for this signature in database
GPG key ID: 6600CC47B1C1B063

View file

@ -6,16 +6,12 @@ from typing import Sequence
from jinja2 import Template
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
from pre_commit_hooks.util import get_template_path
def get_current_branch() -> str:
try:
ref_name = cmd_output('git', 'symbolic-ref', '--short', 'HEAD')
except CalledProcessError:
return ''
ref_name = cmd_output('git', 'symbolic-ref', '--short', 'HEAD')
return ref_name.strip()