aboutsummaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-23 15:42:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-23 15:42:05 -0400
commitd77ff5daddfd9ef73dd04ceda57dfc188054e72e (patch)
tree1b628eee5ccb81313df099caed76603b4b3d0a1a /Limit.hs
parent0732d4c8efcc383919b9016881125dd147886121 (diff)
changelog and minor cleanup to fix mixed spaces/tabs
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Limit.hs b/Limit.hs
index 57d6ebf65..217f38739 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -85,20 +85,20 @@ addIn name = addLimit $ check $ if name == "." then inAnnex else inremote
- of copies. -}
addCopies :: String -> Annex ()
addCopies trust_num = addLimit . check $ readnum num
- where (num, mayCheckTrust) =
- case split ":" trust_num of
- [trust, num'] -> (num', checkTrust (readtrust trust))
- [num'] -> (num', const (return True))
- _ -> bad
- readnum = maybe bad id . readish
- readtrust = maybe bad id . readTrust
+ where
+ (num, mayCheckTrust) = case split ":" trust_num of
+ [trust, num'] -> (num', checkTrust (readtrust trust))
+ [num'] -> (num', const (return True))
+ _ -> bad
+ readnum = maybe bad id . readish
+ readtrust = maybe bad id . readTrust
check n = Backend.lookupFile >=> handle n
handle _ Nothing = return False
handle n (Just (key, _)) = do
us <- filterM mayCheckTrust =<< Remote.keyLocations key
return $ length us >= n
- checkTrust t u = (== t) <$> lookupTrust u -- == or >=
- bad = error "bad number or trust:number for --copies"
+ checkTrust t u = (== t) <$> lookupTrust u
+ bad = error "bad number or trust:number for --copies"
{- Adds a limit to skip files not using a specified key-value backend. -}
addInBackend :: String -> Annex ()