moveFile on windows forgot to delete src file in fallback case
This dates back to commit 625303226d
,
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
This commit is contained in:
parent
622979432b
commit
b111009868
2 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,8 @@ git-annex (10.20250521) UNRELEASED; urgency=medium
|
||||||
entering an adjusted branch.
|
entering an adjusted branch.
|
||||||
* map: Support --json option.
|
* map: Support --json option.
|
||||||
* map: Improve display of remote names.
|
* 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
|
-- Joey Hess <id@joeyh.name> Thu, 22 May 2025 12:43:38 -0400
|
||||||
|
|
||||||
|
|
|
@ -65,10 +65,12 @@ moveFile src dest = tryIO (renamePath src dest) >>= onrename
|
||||||
let (ok, e') = case r of
|
let (ok, e') = case r of
|
||||||
Left err -> (False, err)
|
Left err -> (False, err)
|
||||||
Right _ -> (True, e)
|
Right _ -> (True, e)
|
||||||
|
when ok $
|
||||||
|
void $ tryIO $ removeFile src
|
||||||
#endif
|
#endif
|
||||||
unless ok $ do
|
unless ok $ do
|
||||||
-- delete any partial
|
-- delete any partial
|
||||||
_ <- tryIO $ removeFile tmp
|
void $ tryIO $ removeFile tmp
|
||||||
throwM e'
|
throwM e'
|
||||||
|
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue