optimisation for borg

Skip needing to list importable contents when unchanged since last time.
This commit is contained in:
Joey Hess 2020-12-22 14:35:02 -04:00
parent e1ac42be77
commit 4f9969d0a1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 32 additions and 21 deletions

View file

@ -286,9 +286,9 @@ renameExportM serial adir _k old new = do
, File newloc
]
listImportableContentsM :: AndroidSerial -> AndroidPath -> Annex (ImportableContents (ContentIdentifier, ByteSize))
listImportableContentsM :: AndroidSerial -> AndroidPath -> Annex (Maybe (ImportableContents (ContentIdentifier, ByteSize)))
listImportableContentsM serial adir = adbfind >>= \case
Just ls -> return $ ImportableContents (mapMaybe mk ls) []
Just ls -> return $ Just $ ImportableContents (mapMaybe mk ls) []
Nothing -> giveup "adb find failed"
where
adbfind = adbShell serial