🔨 chore: improve error handling when writing alternates file

This commit is contained in:
Nikita Galaiko 2023-10-19 09:36:24 +02:00 committed by GitButler
parent e3d8b850b6
commit a76ff7b988

View File

@ -49,7 +49,9 @@ impl Repository {
let alternatives_file = self.0.path().join("objects/info/alternates");
std::fs::write(alternatives_file, format!("{path}\n"))?;
if let Err(error) = std::fs::write(&alternatives_file, format!("{path}\n")) {
tracing::warn!(?error, path = %alternatives_file.display(), "failed to write alternates file");
}
Ok(())
}