Repositories / agent-snapshot.git
test_programs/create_and_commit_file.py
Clone (read-only): git clone http://git.guha-anderson.com/git/agent-snapshot.git
import os
import subprocess
from pathlib import Path
repo = Path(os.environ["AGENT_SNAPSHOT_TEST_REPO"])
path = repo / "committed_by_program.txt"
path.write_text("created and committed by traced program\n")
subprocess.run(["git", "add", "committed_by_program.txt"], cwd=repo, check=True)
subprocess.run(["git", "commit", "-m", "Add traced file"], cwd=repo, check=True)