mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-15 20:24:27 +00:00
cleanup: propagate some errors up when failing to write to file
This commit is contained in:
parent
d6a1f9848a
commit
a14114256e
@ -617,7 +617,7 @@ impl MutableIndex {
|
||||
|
||||
let mut temp_file = NamedTempFile::new_in(&dir)?;
|
||||
let file = temp_file.as_file_mut();
|
||||
file.write_all(&buf).unwrap();
|
||||
file.write_all(&buf)?;
|
||||
persist_content_addressed_temp_file(temp_file, &index_file_path)?;
|
||||
|
||||
let mut cursor = Cursor::new(&buf);
|
||||
|
@ -151,7 +151,7 @@ impl IndexStore {
|
||||
) -> io::Result<()> {
|
||||
let mut temp_file = NamedTempFile::new_in(&self.dir)?;
|
||||
let file = temp_file.as_file_mut();
|
||||
file.write_all(index.name().as_bytes()).unwrap();
|
||||
file.write_all(index.name().as_bytes())?;
|
||||
persist_content_addressed_temp_file(
|
||||
temp_file,
|
||||
&self.dir.join("operations").join(op_id.hex()),
|
||||
|
@ -155,7 +155,7 @@ impl Store for LocalStore {
|
||||
|
||||
fn write_symlink(&self, _path: &RepoPath, target: &str) -> Result<SymlinkId, StoreError> {
|
||||
let mut temp_file = NamedTempFile::new_in(&self.path)?;
|
||||
temp_file.write_all(target.as_bytes()).unwrap();
|
||||
temp_file.write_all(target.as_bytes())?;
|
||||
let mut hasher = Blake2b::new();
|
||||
hasher.update(&target.as_bytes());
|
||||
let id = SymlinkId(hasher.finalize().to_vec());
|
||||
|
Loading…
x
Reference in New Issue
Block a user