summaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Limit.hs b/Limit.hs
index 3ae949bfb..c68c3bdd8 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -88,3 +88,10 @@ addCopies num =
handle n (Just (key, _)) = do
us <- keyLocations key
return $ length us >= n
+
+{- Adds a limit to skip files not using a specified key-value backend. -}
+addInBackend :: String -> Annex ()
+addInBackend name = addLimit $ Backend.lookupFile >=> check
+ where
+ wanted = Backend.lookupBackendName name
+ check = return . maybe False ((==) wanted . snd)