convert KeySource to RawFilePath

This commit is contained in:
Joey Hess 2020-02-21 09:34:59 -04:00
parent e468fbc518
commit c31e1be781
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
14 changed files with 74 additions and 55 deletions

View file

@ -90,7 +90,7 @@ hashKeyVariety (Blake2spHash size) he = Blake2spKey size he
{- A key is a hash of its contents. -}
keyValue :: Hash -> KeySource -> MeterUpdate -> Annex (Maybe Key)
keyValue hash source meterupdate = do
let file = contentLocation source
let file = fromRawFilePath (contentLocation source)
filesize <- liftIO $ getFileSize file
s <- hashFile hash file meterupdate
return $ Just $ mkKey $ \k -> k
@ -106,7 +106,7 @@ keyValueE hash source meterupdate =
where
addE k = do
maxlen <- annexMaxExtensionLength <$> Annex.getGitConfig
let ext = selectExtension maxlen (toRawFilePath (keyFilename source))
let ext = selectExtension maxlen (keyFilename source)
return $ Just $ alterKey k $ \d -> d
{ keyName = keyName d <> ext
, keyVariety = hashKeyVariety hash (HasExt True)