pre-commit-hooks/pre_commit_hooks/loaderon_hooks/util/git_helpers.py
Alvaro Andrés Rodríguez Scelza ad0f5863ed updated files names
2019-06-02 02:50:38 -03:00

9 lines
256 B
Python

# -*- coding: utf-8 -*-
import subprocess
def get_current_branch_name():
output = subprocess.check_output(['git', 'symbolic-ref', 'HEAD'])
output = output.splitlines()
head_branches = output[0]
return head_branches.strip().split('/')[-1]