Actually return a sensible error from create_new_file()

This commit is contained in:
Hocuri
2022-01-14 16:53:01 +01:00
committed by Floris Bruynooghe
parent 5aaafb5ac1
commit 8753fd5887

View File

@@ -93,7 +93,7 @@ impl<'a> BlobObject<'a> {
) -> Result<(String, fs::File), BlobError> {
let max_attempt = 15;
let mut name = format!("{}{}", stem, ext);
for attempt in 0..max_attempt {
for attempt in 1..=max_attempt {
let path = dir.join(&name);
match fs::OpenOptions::new()
.create_new(true)