VFS: preserve external destination when overlay move fails #168
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/171"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by mstr-vinegar on 2026-11-23T18:45:43Z.
Problem
Moving an overlay file to a same-volume non-game path can overwrite the destination even when the move fails: copying succeeds, then deleting a source opened without delete sharing fails.
Use a native same-volume rename for this case so Windows checks sharing before replacing the destination. Preserve the existing fallback for cross-volume moves. This complements #160, which handles moves between game paths.
Verification
956a476, the new regression failed because the destination contained the source bytes after the failed move.cargo test --locked -p xcl vfs -- --test-threads=4: 16 passed, 0 failed (Windows 11, Rust 1.100.0 MSVC).Cross-volume and delayed moves retain their existing behavior and are not covered by this fix. AI-assisted implementation and testing.
Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T20:52:37Z.
Merged (main
2abc562), together with #160 - not a duplicate of it: #160 covers a destination inside the game folder, this one a destination outside it. The conflict was resolved by keeping both paths; the external one now calls #160'scommit_overlay_removal(sr)instead ofdelete_file(sr)(same effect: the original stays hidden and the move is recorded). Both tests are kept and pass. Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main38b05b7:cargo build --workspace && cargo test --workspace -- --test-threads=4- 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.