improve matcher data type to allow matching Keys, instead of just files (no behavior changes)
This commit is contained in:
parent
a135bbd5a2
commit
8ce515ffe4
8 changed files with 49 additions and 39 deletions
|
@ -13,9 +13,11 @@ import Limit
|
|||
import Types.FileMatcher
|
||||
|
||||
addWantGet :: Annex ()
|
||||
addWantGet = addLimit $ Right $ const $
|
||||
\fileinfo -> wantGet False (Just $ matchFile fileinfo)
|
||||
addWantGet = addLimit $ Right $ const $ checkWant $ wantGet False
|
||||
|
||||
addWantDrop :: Annex ()
|
||||
addWantDrop = addLimit $ Right $ const $
|
||||
\fileinfo -> wantDrop False Nothing (Just $ matchFile fileinfo)
|
||||
addWantDrop = addLimit $ Right $ const $ checkWant $ wantDrop False Nothing
|
||||
|
||||
checkWant :: (Maybe FilePath -> Annex Bool) -> MatchInfo -> Annex Bool
|
||||
checkWant a (MatchingFile fi) = a (Just $ matchFile fi)
|
||||
checkWant _ (MatchingKey _) = return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue