mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-31 02:36:52 +00:00
fix tests to handle default branch main or master
This commit is contained in:
parent
31903eabdb
commit
c96572c378
3 changed files with 24 additions and 6 deletions
|
|
@ -14,3 +14,8 @@ def get_resource_path(path):
|
|||
def git_commit(*args, **kwargs):
|
||||
cmd = ('git', 'commit', '--no-gpg-sign', '--no-verify', '--no-edit', *args)
|
||||
subprocess.check_call(cmd, **kwargs)
|
||||
|
||||
|
||||
def get_default_branch():
|
||||
cmd = ('git', 'config', '--get', 'init.defaultBranch')
|
||||
return subprocess.getoutput(cmd).strip() or 'master'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue