remove Windows experiment (#3601)

The sync-all didn't do anything, and one would still run into locked
files.
This commit is contained in:
Sebastian Thiel 2024-05-25 08:57:41 +02:00
parent 1dc8988c3c
commit a176bf04cf
No known key found for this signature in database
GPG Key ID: 9CB5EE7895E8268B
2 changed files with 1 additions and 8 deletions

View File

@ -85,18 +85,12 @@ pub(crate) fn create_dirs_then_write<P: AsRef<Path>>(
persist_tempfile(temp_file, file_path)
}
#[allow(dead_code)]
fn persist_tempfile(
tempfile: gix::tempfile::Handle<gix::tempfile::handle::Writable>,
to_path: impl AsRef<Path>,
) -> std::io::Result<()> {
match tempfile.persist(to_path) {
Ok(Some(_opened_file)) => {
// EXPERIMENT: Does this fix #3601?
#[cfg(windows)]
_opened_file.sync_all()?;
Ok(())
}
Ok(Some(_opened_file)) => Ok(()),
Ok(None) => unreachable!(
"BUG: a signal has caused the tempfile to be removed, but we didn't install a handler"
),

View File

@ -17,7 +17,6 @@ test = false
tauri-build = { version = "1.5", features = [] }
[dev-dependencies]
#once_cell = "1.19"
pretty_assertions = "1.4"
tempfile = "3.10"
gitbutler-testsupport.workspace = true