From 2e808304f546536277adf7611e19a0c4f7108dfe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Nov 2013 14:14:44 -0400 Subject: map: Work when there are gcrypt remotes. --- Git/Construct.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Git/Construct.hs') 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] -- cgit v1.2.3