import pathlib,sys,subprocess
home=pathlib.Path(sys.argv[1])
for variant in ['normal','always']:
 repo=home/'fixtures'/variant/'push-demo'
 def git(*args):return subprocess.check_output(['git',*args],cwd=repo,text=True,stderr=subprocess.STDOUT).strip()
 print('\nFixture:',variant)
 print('autoSetupMerge:',subprocess.run(['git','config','--get','branch.autoSetupMerge'],cwd=repo,text=True,capture_output=True).stdout.strip() or '(default)')
 print('Working tree:',git('status','--short','--branch'))
 print('Local branches:',git('for-each-ref','--format=%(refname:short) %(objectname:short) upstream=%(upstream:short)','refs/heads'))
 print('Published branches:',git('ls-remote','--heads','origin'))
 print('Latest commit:',git('log','-1','--format=%h %s'))
