use std::fs;
use std::process::Command;
use tempfile::TempDir;
pub fn create_test_repo() -> TempDir {
let temp = TempDir::new().unwrap();
Command::new("git")
.args(["init"])
.current_dir(temp.path())
.output()
.expect("Failed to init git repo");
Command::new("git")
.args(["config", "user.email", "test@example.com"])
.current_dir(temp.path())
.output()
.expect("Failed to configure git email");
Command::new("git")
.args(["config", "user.name", "Test User"])
.current_dir(temp.path())
.output()
.expect("Failed to configure git name");
fs::write(temp.path().join("README.md"), "# Test Project").unwrap();
Command::new("git")
.args(["add", "."])
.current_dir(temp.path())
.output()
.expect("Failed to stage files");
Command::new("git")
.args(["commit", "-m", "Initial commit"])
.current_dir(temp.path())
.output()
.expect("Failed to create initial commit");
temp
}