avoid unnecessary log changes when re-adding the same url

This commit is contained in:
Joey Hess 2012-02-17 23:58:56 -04:00
parent 5bf07b3b5c
commit 0fada43808

View file

@ -47,6 +47,8 @@ getUrls key = go $ urlLog key : oldurlLogs key
{- Records a change in an url for a key. -}
setUrl :: Key -> URLString -> LogStatus -> Annex ()
setUrl key url status = do
us <- getUrls key
unless (status == InfoPresent && url `elem` us) $ do
addLog (urlLog key) =<< logNow status url
-- update location log to indicate that the web has the key, or not