avoid unix-compat's rename

On Windows, that does not support long paths
https://github.com/jacobstanley/unix-compat/issues/56

Instead, use System.Directory.renamePath, which does support long paths.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-07-12 14:53:32 -04:00
parent bad39cadc6
commit 2d65c4ff1d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
18 changed files with 75 additions and 20 deletions

View file

@ -30,7 +30,7 @@ import Annex.CheckIgnore
import qualified Utility.RawFilePath as R
import qualified System.FilePath.ByteString as P
import System.PosixCompat.Files
import System.PosixCompat.Files (fileSize)
cmd :: Command
cmd = notBareRepo $

View file

@ -181,11 +181,11 @@ runFuzzAction (FuzzAdd (FuzzFile f)) = do
runFuzzAction (FuzzDelete (FuzzFile f)) = liftIO $
removeWhenExistsWith R.removeLink (toRawFilePath f)
runFuzzAction (FuzzMove (FuzzFile src) (FuzzFile dest)) = liftIO $
rename src dest
R.rename (toRawFilePath src) (toRawFilePath dest)
runFuzzAction (FuzzDeleteDir (FuzzDir d)) = liftIO $
removeDirectoryRecursive d
runFuzzAction (FuzzMoveDir (FuzzDir src) (FuzzDir dest)) = liftIO $
rename src dest
R.rename (toRawFilePath src) (toRawFilePath dest)
runFuzzAction (FuzzPause d) = randomDelay d
genFuzzAction :: Annex FuzzAction

View file

@ -216,7 +216,7 @@ storeReceived f = do
Just k -> void $ logStatusAfter k $
getViaTmpFromDisk RetrievalVerifiableKeysSecure AlwaysVerify k (AssociatedFile Nothing) $ \dest -> unVerified $
liftIO $ catchBoolIO $ do
rename f (fromRawFilePath dest)
R.rename (toRawFilePath f) dest
return True
-- Under Windows, uftp uses key containers, which are not files on the