mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
Remove unused try catch
Since return code from cmd_output is ignored the try catch can be ignored.
This commit is contained in:
parent
e7acd0dcf2
commit
3575cf7c02
1 changed files with 1 additions and 5 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue