summaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-20 00:10:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-20 00:10:12 -0400
commite8afcf6e6dcda746ed365c1b64de3b2171418830 (patch)
treee220837a41ad25eb4f722d7ae8dcabc571d26be2 /Limit.hs
parent1018c549a7e0c7442239533d0c62c83a0978f7d6 (diff)
Improve behavior when unable to parse a preferred content expression (thanks, ion).
Fall back to "present" as the preferred conent expression, which will not result in any content movement.
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Limit.hs b/Limit.hs
index 37353c33e..7654842e1 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -120,7 +120,10 @@ addIn s = addLimit =<< mk
{- Limit to content that is currently present on a uuid. -}
limitPresent :: Maybe UUID -> MkLimit
-limitPresent u _ = Right $ const $ checkKey $ \key -> do
+limitPresent u _ = Right $ matchPresent u
+
+matchPresent :: Maybe UUID -> MatchFiles
+matchPresent u _ = checkKey $ \key -> do
hereu <- getUUID
if u == Just hereu || isNothing u
then inAnnex key