1
0
mirror of https://github.com/j178/prek.git synced 2026-05-05 18:25:21 +02:00

Workaround checkout file failure on Windows (#616)

This commit is contained in:
Jo
2025-09-03 18:48:04 +08:00
committed by GitHub
parent 7292b9bade
commit 2db7eb56dd
+13
View File
@@ -218,6 +218,19 @@ async fn update_repo(repo: &RemoteRepo, bleeding_edge: bool, freeze: bool) -> Re
}
}
// Workaround for Windows: https://github.com/pre-commit/pre-commit/issues/2865,
// https://github.com/j178/prek/issues/614
if cfg!(windows) {
git::git_cmd("git show")?
.arg("show")
.arg(format!("{rev}:{MANIFEST_FILE}"))
.current_dir(tmp_dir.path())
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.await?;
}
git::git_cmd("git checkout")?
.arg("checkout")
.arg("--quiet")