fix tests to handle default branch main or master

This commit is contained in:
Ryan Downing 2025-03-27 22:45:38 -04:00
parent 31903eabdb
commit c96572c378
3 changed files with 24 additions and 6 deletions

View file

@ -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'