This dates back to commit
625303226dc94c2f35a5a4835b7c53c582014643,
where a cross-device moveFile on Windows was made to fall back to copying
to the destination, but forgot to delete the source file.
Should fix the following test suite failure on Windows:
import: FAIL (2.52s)
.\Test\Framework.hs:383:
C:\Users\RUNNER~1\AppData\Local\Temp\importtest.0\import1\f exists unexpectedly
Use -p '/import/' to rerun this test only.
Which was seen here, running the test suite in the github action environment.
https://github.com/psychoinformatics-de/git-annex-wheel/issues/5
entering an adjusted branch.
* map: Support --json option.
* map: Improve display of remote names.
+ * Windows: Fix duplicate file bug that could occur when files were
+ supposed to be moved across devices.
-- Joey Hess <id@joeyh.name> Thu, 22 May 2025 12:43:38 -0400
let (ok, e') = case r of
Left err -> (False, err)
Right _ -> (True, e)
+ when ok $
+ void $ tryIO $ removeFile src
#endif
unless ok $ do
-- delete any partial
- _ <- tryIO $ removeFile tmp
+ void $ tryIO $ removeFile tmp
throwM e'
#ifndef mingw32_HOST_OS