diff --git a/Limit.hs b/Limit.hs index 62c5456fe3..37353c33e3 100644 --- a/Limit.hs +++ b/Limit.hs @@ -94,18 +94,16 @@ matchGlobFile glob = go {- Adds a limit to skip files not believed to be present - in a specfied repository. Optionally on a prior date. -} addIn :: String -> Annex () -addIn = addLimit . limitIn - -limitIn :: MkLimit -limitIn s = Right $ \notpresent -> checkKey $ \key -> - if name == "." - then if null date - then inhere notpresent key - else inuuid notpresent key =<< getUUID - else inuuid notpresent key =<< Remote.nameToUUID name +addIn s = addLimit =<< mk where (name, date) = separate (== '@') s - inuuid notpresent key u + mk + | name == "." = if null date + then use inhere + else use . inuuid =<< getUUID + | otherwise = use . inuuid =<< Remote.nameToUUID name + use a = return $ Right $ \notpresent -> checkKey (a notpresent) + inuuid u notpresent key | null date = do us <- Remote.keyLocations key return $ u `elem` us && u `S.notMember` notpresent