convert listImportableContents to throwing exceptions

This commit is contained in:
Joey Hess 2020-12-22 14:20:11 -04:00
parent 5d8e4a7c74
commit e1ac42be77
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 27 additions and 27 deletions

View file

@ -132,7 +132,7 @@ borgLocal = notElem ':'
-- XXX the tree generated by using this does not seem to get grafted into
-- the git-annex branch, so would be subject to being lost to GC.
-- Is this a general problem affecting importtree too?
listImportableContentsM :: UUID -> BorgRepo -> Annex (Maybe (ImportableContents (ContentIdentifier, ByteSize)))
listImportableContentsM :: UUID -> BorgRepo -> Annex (ImportableContents (ContentIdentifier, ByteSize))
listImportableContentsM u borgrepo = prompt $ do
imported <- getImported u
ls <- withborglist borgrepo "{barchive}{NUL}" $ \as ->
@ -143,7 +143,7 @@ listImportableContentsM u borgrepo = prompt $ do
let archive = borgrepo ++ "::" ++ decodeBS' archivename
in withborglist archive "{size}{NUL}{path}{NUL}" $
liftIO . evaluate . force . parsefilelist archivename
return $ Just $ mkimportablecontents ls
return $ mkimportablecontents ls
where
withborglist what format a = do
let p = (proc "borg" ["list", what, "--format", format])