diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-14 18:17:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-14 18:18:28 -0400 |
commit | 9fa92141064a7682e1559bfa91a360c1ad5cb3dc (patch) | |
tree | d009792edd0eb6143080458dd086165acb9cbff8 /Remote/Git.hs | |
parent | 3e07780bf881988eed491e1451b95cab86b7f552 (diff) |
A remote can have a annexUrl configured, that is used by git-annex instead of its usual url. (Similar to pushUrl.)
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r-- | Remote/Git.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs index 183fcd854..e9919e636 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -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 |