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:
parent
c873586e14
commit
d9fd205cbb
12 changed files with 38 additions and 44 deletions
|
@ -417,16 +417,15 @@ verifyWorkTree key file = do
|
|||
Just k | k == key -> whenM (inAnnex key) $ do
|
||||
showNote "fixing worktree content"
|
||||
replaceWorkTreeFile (fromRawFilePath file) $ \tmp -> do
|
||||
let tmp' = toRawFilePath tmp
|
||||
mode <- liftIO $ catchMaybeIO $ fileMode <$> R.getFileStatus file
|
||||
ifM (annexThin <$> Annex.getGitConfig)
|
||||
( void $ linkFromAnnex' key tmp' mode
|
||||
( void $ linkFromAnnex' key tmp mode
|
||||
, do
|
||||
obj <- calcRepo (gitAnnexLocation key)
|
||||
void $ checkedCopyFile key obj tmp' mode
|
||||
thawContent tmp'
|
||||
void $ checkedCopyFile key obj tmp mode
|
||||
thawContent tmp
|
||||
)
|
||||
Database.Keys.storeInodeCaches key [tmp']
|
||||
Database.Keys.storeInodeCaches key [tmp]
|
||||
_ -> return ()
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue