split ProvidedInfo and UserProvidedInfo

The latter is for git-annex matchexpression and matching against it can
throw an exception. Splitting out the former reduces the potential for
mistakes and avoids needing to worry about matching against that
throwing an exception.

This is more groundwork for matching largefiles while importing,
without downloading content.

This commit was sponsored by Graham Spencer on Patreon.
This commit is contained in:
Joey Hess 2020-09-28 12:06:10 -04:00
parent 00dbe35fbc
commit 8b74f01a26
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 93 additions and 62 deletions

View file

@ -38,4 +38,5 @@ addPreferredContentLimit a = do
checkWant :: (AssociatedFile -> Annex Bool) -> MatchInfo -> Annex Bool
checkWant a (MatchingFile fi) = a (AssociatedFile (Just $ matchFile fi))
checkWant a (MatchingKey _ af) = a af
checkWant _ (MatchingInfo {}) = return False
checkWant a (MatchingInfo p) = a (AssociatedFile (Just $ providedFilePath p))
checkWant _ (MatchingUserInfo {}) = return False