use RawFilePath version of rename
Some small wins, almost certianly swamped by the system calls, but still worthwhile progress on the RawFilePath conversion. Sponsored-by: Erik Bjäreholt on Patreon
This commit is contained in:
parent
d00e23cac9
commit
debcf86029
16 changed files with 58 additions and 54 deletions
|
@ -28,6 +28,7 @@ import Utility.InodeCache
|
|||
import Annex.InodeSentinal
|
||||
import Annex.CheckIgnore
|
||||
import qualified Utility.RawFilePath as R
|
||||
import qualified System.FilePath.ByteString as P
|
||||
|
||||
import System.PosixCompat.Files
|
||||
|
||||
|
@ -208,15 +209,15 @@ start si file addunlockedmatcher =
|
|||
starting "add" (ActionItemTreeFile file) si $
|
||||
addingExistingLink file key $
|
||||
withOtherTmp $ \tmp -> do
|
||||
let tmpf = fromRawFilePath tmp </> fromRawFilePath file
|
||||
liftIO $ moveFile (fromRawFilePath file) tmpf
|
||||
ifM (isSymbolicLink <$> liftIO (getSymbolicLinkStatus tmpf))
|
||||
let tmpf = tmp P.</> file
|
||||
liftIO $ moveFile file tmpf
|
||||
ifM (isSymbolicLink <$> liftIO (R.getSymbolicLinkStatus tmpf))
|
||||
( do
|
||||
liftIO $ removeFile tmpf
|
||||
liftIO $ R.removeLink tmpf
|
||||
addSymlink file key Nothing
|
||||
next $ cleanup key =<< inAnnex key
|
||||
, do
|
||||
liftIO $ moveFile tmpf (fromRawFilePath file)
|
||||
liftIO $ moveFile tmpf file
|
||||
next $ return True
|
||||
)
|
||||
fixuppointer s key =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue