mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 12:54:17 +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 jinja2 import Template
|
||||||
|
|
||||||
from pre_commit_hooks.util import CalledProcessError
|
|
||||||
from pre_commit_hooks.util import cmd_output
|
from pre_commit_hooks.util import cmd_output
|
||||||
from pre_commit_hooks.util import get_template_path
|
from pre_commit_hooks.util import get_template_path
|
||||||
|
|
||||||
|
|
||||||
def get_current_branch() -> str:
|
def get_current_branch() -> str:
|
||||||
try:
|
ref_name = cmd_output('git', 'symbolic-ref', '--short', 'HEAD')
|
||||||
ref_name = cmd_output('git', 'symbolic-ref', '--short', 'HEAD')
|
|
||||||
except CalledProcessError:
|
|
||||||
return ''
|
|
||||||
|
|
||||||
return ref_name.strip()
|
return ref_name.strip()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue