finished this stage of the RawFilePath conversion

This commit was sponsored by Denis Dzyubenko on Patreon.
This commit is contained in:
Joey Hess 2020-11-06 14:10:58 -04:00
parent 2c8cf06e75
commit 1db49497e0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
27 changed files with 100 additions and 93 deletions

View file

@ -13,6 +13,7 @@ import Data.Default
import Data.ByteString.Builder
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
import qualified System.FilePath.ByteString as P
import Annex.Common
import Annex.Content
@ -74,12 +75,13 @@ moveContent = do
forM_ files move
where
move f = do
let k = fileKey1 (takeFileName f)
let d = fromRawFilePath $ parentDir $ toRawFilePath f
let f' = toRawFilePath f
let k = fileKey1 (fromRawFilePath (P.takeFileName f'))
let d = parentDir f'
liftIO $ allowWrite d
liftIO $ allowWrite f
_ <- moveAnnex k (toRawFilePath f)
liftIO $ removeDirectory d
liftIO $ allowWrite f'
_ <- moveAnnex k f'
liftIO $ removeDirectory (fromRawFilePath d)
updateSymlinks :: Annex ()
updateSymlinks = do
@ -215,7 +217,8 @@ lookupKey1 file = do
" (unknown backend " ++ bname ++ ")"
getKeyFilesPresent1 :: Annex [FilePath]
getKeyFilesPresent1 = getKeyFilesPresent1' =<< fromRepo gitAnnexObjectDir
getKeyFilesPresent1 = getKeyFilesPresent1' . fromRawFilePath
=<< fromRepo gitAnnexObjectDir
getKeyFilesPresent1' :: FilePath -> Annex [FilePath]
getKeyFilesPresent1' dir =
ifM (liftIO $ doesDirectoryExist dir)