aboutsummaryrefslogtreecommitdiff
path: root/Git/Construct.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-04 14:14:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-04 14:14:44 -0400
commit2e808304f546536277adf7611e19a0c4f7108dfe (patch)
tree9b23102ee03bc9ad84d72b265607b5ce86fd2b0c /Git/Construct.hs
parentbc71810c8e270d938c73fbe2b3a53808803fa417 (diff)
map: Work when there are gcrypt remotes.
Diffstat (limited to 'Git/Construct.hs')
-rw-r--r--Git/Construct.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Git/Construct.hs b/Git/Construct.hs
index 6514b80bc..cd998591e 100644
--- a/Git/Construct.hs
+++ b/Git/Construct.hs
@@ -104,14 +104,16 @@ localToUrl :: Repo -> Repo -> Repo
localToUrl reference r
| not $ repoIsUrl reference = error "internal error; reference repo not url"
| repoIsUrl r = r
- | otherwise = r { location = Url $ fromJust $ parseURI absurl }
- where
- absurl = concat
- [ Url.scheme reference
- , "//"
- , Url.authority reference
- , repoPath r
- ]
+ | otherwise = case Url.authority reference of
+ Nothing -> r
+ Just auth ->
+ let absurl = concat
+ [ Url.scheme reference
+ , "//"
+ , auth
+ , repoPath r
+ ]
+ in r { location = Url $ fromJust $ parseURI absurl }
{- Calculates a list of a repo's configured remotes, by parsing its config. -}
fromRemotes :: Repo -> IO [Repo]