Added --expected-present file matching option

This commit is contained in:
Joey Hess 2024-01-25 12:56:41 -04:00
parent 1d17e4ee16
commit b9e147d282
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 44 additions and 3 deletions

View file

@ -330,6 +330,22 @@ addIn s = do
then return False
else inAnnex key
{- Limit to content that location tracking expects to be present
- in the current repository. Does not verify inAnnex. -}
addExpectedPresent :: Annex ()
addExpectedPresent = do
hereu <- getUUID
addLimit $ Right $ MatchFiles
{ matchAction = const $ checkKey $ \key -> do
us <- Remote.keyLocations key
return $ hereu `elem` us
, matchNeedsFileName = False
, matchNeedsFileContent = False
, matchNeedsKey = True
, matchNeedsLocationLog = True
, matchDesc = matchDescSimple "expected-present"
}
{- Limit to content that is currently present on a uuid. -}
limitPresent :: Maybe UUID -> MatchFiles Annex
limitPresent u = MatchFiles