summaryrefslogtreecommitdiff
path: root/Git/Construct.hs
diff options
context:
space:
mode:
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]