pre-commit-hooks/pre_commit_hooks/loaderon-hooks/util/git_helpers.py
Alvaro Andrés Rodríguez Scelza 0a66e6635d Added loaderon-hooks logic
2019-06-02 02:10:25 -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]