make MatchFiles introspectable

matchNeedsFileContent is not used yet, but shows how to add information
about terminals. That one would be needed for
https://git-annex.branchable.com/todo/sync_fast_import/

Note the tricky bit in Annex.FileMatcher.call where it folds over the
included matcher to propagate the information.

This commit was sponsored by Svenne Krap on Patreon.
This commit is contained in:
Joey Hess 2020-09-24 13:55:19 -04:00
parent 6d95361f35
commit c1b4d76e6b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 146 additions and 66 deletions

View file

@ -91,7 +91,8 @@ seek o = do
, liftIO exitFailure
)
where
checkmatcher matcher = matchMrun matcher $ \a -> a S.empty (matchinfo o)
checkmatcher matcher = matchMrun matcher $ \op ->
matchAction op S.empty (matchinfo o)
bail :: String -> IO a
bail s = do