diff options
Diffstat (limited to 'Annex/UUID.hs')
-rw-r--r-- | Annex/UUID.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Annex/UUID.hs b/Annex/UUID.hs index d3d674dcc..6fc04c0f0 100644 --- a/Annex/UUID.hs +++ b/Annex/UUID.hs @@ -45,23 +45,23 @@ getUUID = getRepoUUID =<< gitRepo {- Looks up a repo's UUID. May return "" if none is known. -} getRepoUUID :: Git.Repo -> Annex UUID getRepoUUID r = do - g <- gitRepo - - let c = cached g + c <- fromRepo cached let u = getUncachedUUID r if c /= u && u /= NoUUID then do - updatecache g u + updatecache u return u else return c where - cached g = toUUID $ Git.configGet g cachekey "" - updatecache g u = when (g /= r) $ storeUUID cachekey u + cached g = toUUID $ Git.configGet cachekey "" g + updatecache u = do + g <- gitRepo + when (g /= r) $ storeUUID cachekey u cachekey = "remote." ++ fromMaybe "" (Git.repoRemoteName r) ++ ".annex-uuid" getUncachedUUID :: Git.Repo -> UUID -getUncachedUUID r = toUUID $ Git.configGet r configkey "" +getUncachedUUID = toUUID . Git.configGet configkey "" {- Make sure that the repo has an annex.uuid setting. -} prepUUID :: Annex () |