aboutsummaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-03 13:23:34 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-03 13:23:34 -0400
commit01c701b5a5c18cfa952394ae1cbd2249cfd08f51 (patch)
tree8ca806e20912726ff1d2df7d3271a86426603d48 /Limit.hs
parentaf197c7fc387794d3a558b4f8f23ebd9d5554aa0 (diff)
simplify
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Limit.hs b/Limit.hs
index b8053e6de..81b6d7564 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -118,11 +118,8 @@ addIn s = addLimit =<< mk
else inAnnex key
{- Limit to content that is currently present on a uuid. -}
-limitPresent :: Maybe UUID -> MkLimit Annex
-limitPresent u _ = Right $ matchPresent u
-
-matchPresent :: Maybe UUID -> MatchFiles Annex
-matchPresent u _ = checkKey $ \key -> do
+limitPresent :: Maybe UUID -> MatchFiles Annex
+limitPresent u _ = checkKey $ \key -> do
hereu <- getUUID
if u == Just hereu || isNothing u
then inAnnex key
@@ -131,8 +128,8 @@ matchPresent u _ = checkKey $ \key -> do
return $ maybe False (`elem` us) u
{- Limit to content that is in a directory, anywhere in the repository tree -}
-limitInDir :: FilePath -> MkLimit Annex
-limitInDir dir = const $ Right $ const go
+limitInDir :: FilePath -> MatchFiles Annex
+limitInDir dir = const go
where
go (MatchingFile fi) = checkf $ matchFile fi
go (MatchingKey _) = return False