summaryrefslogtreecommitdiff
path: root/Remotes.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-19 13:08:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-19 13:08:05 -0400
commit3531ce5c54e380d15d54d838c90f4ebe311782af (patch)
tree9ff4c4efffd4a654dda4f73bd77da55bb0f53956 /Remotes.hs
parentd23fc22f0e17c95765f940f81f733f9580e19107 (diff)
fix remote uuid learning bug
Diffstat (limited to 'Remotes.hs')
-rw-r--r--Remotes.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Remotes.hs b/Remotes.hs
index f21f5a6ba..828dc753f 100644
--- a/Remotes.hs
+++ b/Remotes.hs
@@ -30,17 +30,22 @@ withKey key = do
g <- Annex.gitRepo
uuids <- liftIO $ keyLocations g key
allremotes <- remotesByCost
- -- this only uses cached data, so may not find new remotes
+ -- This only uses cached data, so may not include new remotes
+ -- or remotes whose uuid has changed (eg by a different drive being
+ -- mounted at their location). So unless it happens to find all
+ -- remotes, try harder, loading the remotes' configs.
remotes <- reposByUUID allremotes uuids
- if (0 == length remotes)
+ remotesread <- Annex.flagIsSet RemotesRead
+ if ((length allremotes /= length remotes) && not remotesread)
then tryharder allremotes uuids
else return remotes
where
tryharder allremotes uuids = do
- -- more expensive; check each remote's config
+ -- more expensive; read each remote's config
mayberemotes <- mapM tryGitConfigRead allremotes
let allremotes' = catMaybes mayberemotes
remotes' <- reposByUUID allremotes' uuids
+ Annex.flagChange RemotesRead True
return remotes'
{- Cost Ordered list of remotes. -}