more OsPath conversion (650/749)

Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
Joey Hess 2025-02-07 17:03:31 -04:00
parent c74c75b352
commit 5eef09a3cc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 79 additions and 78 deletions

View file

@ -233,7 +233,7 @@ listImportableContentsM u borgrepo c = prompt $ do
-- importable keys, so avoids needing to buffer all
-- the rest of the files in memory.
in case ThirdPartyPopulated.importKey' loc reqsz of
Just k -> (fromOsPath loc, (borgContentIdentifier, retsz k))
Just k -> (loc, (borgContentIdentifier, retsz k))
: parsefilelist archivename rest
Nothing -> parsefilelist archivename rest
parsefilelist _ _ = []
@ -296,7 +296,7 @@ extractImportLocation loc = go $ splitDirectories $
-- last imported tree. And the contents of those archives can be retrieved
-- by listing the subtree recursively, which will likely be quite a lot
-- faster than running borg.
getImported :: UUID -> Annex (M.Map BorgArchiveName (Annex [(RawFilePath, (ContentIdentifier, ByteSize))]))
getImported :: UUID -> Annex (M.Map BorgArchiveName (Annex [(OsPath, (ContentIdentifier, ByteSize))]))
getImported u = M.unions <$> (mapM go . exportedTreeishes =<< getExport u)
where
go t = M.fromList . mapMaybe mk
@ -317,7 +317,7 @@ getImported u = M.unions <$> (mapM go . exportedTreeishes =<< getExport u)
mkImportLocation $ getTopFilePath $ LsTree.file ti
k <- fileKey (takeFileName f)
return
( fromOsPath (genImportLocation f)
( genImportLocation f
,
( borgContentIdentifier
-- defaulting to 0 size is ok, this size