from pathlib import Path
import subprocess,sys
repo=Path(sys.argv[1]);repo.mkdir(parents=True,exist_ok=True)
def git(*args): subprocess.run(['git',*args],cwd=repo,check=True,stdout=subprocess.DEVNULL)
git('init','-b','main');git('config','user.name','Scenario');git('config','user.email','scenario@example.invalid')
(repo/'notes.txt').write_text('Original note\n');git('add','.');git('commit','-m','Initial note');git('switch','-c','feature');git('commit','--allow-empty','-m','Feature commit');git('switch','--orphan','unrelated');git('commit','--allow-empty','-m','Unrelated root');git('switch','feature');git('config','branch.feature.t3-merge-base-ref','refs/heads/unrelated')
(repo/'notes.txt').write_text('Original note\nUncommitted note\n')
