summaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Limit.hs b/Limit.hs
index 4aeb8bafb..51f3fc950 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -10,6 +10,7 @@ module Limit where
import Text.Regex.PCRE.Light.Char8
import System.Path.WildMatch
import Control.Monad (filterM)
+import Control.Applicative
import Data.Maybe
import Annex
@@ -27,6 +28,10 @@ filterFiles l = do
matcher <- getMatcher
filterM (Utility.Matcher.matchM matcher) l
+{- Checks if there are user-specified limits. -}
+limited :: Annex Bool
+limited = (not . Utility.Matcher.matchesAny) <$> getMatcher
+
{- Gets a matcher for the user-specified limits. The matcher is cached for
- speed; once it's obtained the user-specified limits can't change. -}
getMatcher :: Annex (Utility.Matcher.Matcher (FilePath -> Annex Bool))