fix(xtask): reset fixtures when checking out new version

This commit is contained in:
Amaan Qureshi 2025-09-03 12:33:47 -04:00 committed by Amaan Qureshi
parent 3b0273fc61
commit f95a52df4a

View file

@ -59,6 +59,15 @@ pub fn run_fixtures(args: &FetchFixtures) -> Result<()> {
&format!("Failed to fetch tag {tag} for {grammar} grammar"),
)?;
let mut reset_command = Command::new("git");
reset_command
.current_dir(&grammar_dir)
.args(["reset", "--hard", "HEAD"]);
bail_on_err(
&reset_command.spawn()?.wait_with_output()?,
&format!("Failed to reset {grammar} grammar working tree"),
)?;
let mut checkout_command = Command::new("git");
checkout_command
.current_dir(&grammar_dir)