mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 03:56:54 +00:00
Added loaderon-hooks logic
This commit is contained in:
parent
0b70e285e3
commit
0a66e6635d
23 changed files with 612 additions and 0 deletions
9
pre_commit_hooks/loaderon-hooks/util/git_helpers.py
Normal file
9
pre_commit_hooks/loaderon-hooks/util/git_helpers.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# -*- 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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue