A remote can have a annexUrl configured, that is used by git-annex instead of its usual url. (Similar to pushUrl.)

This commit is contained in:
Joey Hess 2011-10-14 18:17:46 -04:00
commit 9fa9214106
6 changed files with 44 additions and 8 deletions

View file

@ -34,7 +34,18 @@ remote = RemoteType {
list :: Annex [Git.Repo]
list = do
g <- gitRepo
return $ Git.remotes g
let c = Git.configMap g
mapM (tweakurl c) $ Git.remotes g
where
annexurl n = "remote." ++ n ++ ".annexurl"
tweakurl c r = do
let n = fromJust $ Git.repoRemoteName r
case M.lookup (annexurl n) c of
Nothing -> return r
Just url -> do
g <- gitRepo
r' <- liftIO $ Git.genRemote g url
return $ Git.repoRemoteNameSet r' n
gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex)
gen r u _ = do