go go gadget hlint

This commit is contained in:
Joey Hess 2011-09-20 23:24:48 -04:00
parent 9d26192350
commit 9f6b7935dd
21 changed files with 35 additions and 37 deletions

View file

@ -69,7 +69,7 @@ addExclude glob = addLimit $ return . notExcluded
addIn :: String -> Annex ()
addIn name = do
u <- Remote.nameToUUID name
addLimit $ if name == "." then check local else check (remote u)
addLimit $ if name == "." then check inAnnex else check (remote u)
where
check a f = Backend.lookupFile f >>= handle a
handle _ Nothing = return False
@ -77,12 +77,11 @@ addIn name = do
remote u key = do
us <- keyLocations key
return $ u `elem` us
local key = inAnnex key
{- Adds a limit to skip files not believed to have the specified number
- of copies. -}
addCopies :: String -> Annex ()
addCopies num = do
addCopies num =
case readMaybe num :: Maybe Int of
Nothing -> error "bad number for --copies"
Just n -> addLimit $ check n