Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid attempting rename in copy fallback path (#1546)
## Summary This _could_ fix #1454, but I'm not sure. I was able to replicate by forcing a bunch of error states. But, in short, if we fail to hardlink on the initial copy due to a file existing, and then fail _again_, we fallback to copying. But if we copy, then the tempfile doesn't exist, and so the `fs_err::rename(&tempfile, &out_path)?;` will fail with "File not found". This PR just ensures that the cases are explicitly mutually exclusive: we only attempt to rename if the hardlink succeeded.
- Loading branch information