summaryrefslogtreecommitdiff
path: root/Limit/Wanted.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Limit/Wanted.hs')
-rw-r--r--Limit/Wanted.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Limit/Wanted.hs b/Limit/Wanted.hs
index ed4529dea..7e9278202 100644
--- a/Limit/Wanted.hs
+++ b/Limit/Wanted.hs
@@ -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