aboutsummaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-28 17:37:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-28 17:45:47 -0400
commite32ab766b08b9a64bf12fe5ab6bf33f2d82b0fb7 (patch)
tree8fdccb1bd129e25af9d6ba84bb32e04b40992c1f /Limit.hs
parent16653132b7f7452b9c3758696093eda0f2d543c1 (diff)
--inbackend can be used to make git-annex only operate on files whose content is stored using a specified key-value backend.
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)