push RawFilePath down into Annex.ReplaceFile

Minor optimisation, but a win in every case, except for a couple where
it's a wash.

Note that replaceFile still takes a FilePath, because it needs to
operate on Chars to truncate unicode filenames properly.
This commit is contained in:
Joey Hess 2023-10-26 13:36:49 -04:00
parent c873586e14
commit d9fd205cbb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
12 changed files with 38 additions and 44 deletions

View file

@ -242,7 +242,7 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
stageSymlink dest' =<< hashSymlink l
replacewithsymlink dest link = replaceWorkTreeFile dest $
makeGitLink link . toRawFilePath
makeGitLink link
makepointer key dest destmode = do
unless inoverlay $
@ -267,10 +267,10 @@ resolveMerge' unstagedmap (Just us) them inoverlay u = do
Nothing -> noop
Just sha -> replaceWorkTreeFile item $ \tmp -> do
c <- catObject sha
liftIO $ L.writeFile tmp c
liftIO $ L.writeFile (decodeBS tmp) c
when isexecutable $
liftIO $ void $ tryIO $
modifyFileMode (toRawFilePath tmp) $
modifyFileMode tmp $
addModes executeModes
-- Update the work tree to reflect the graft.