summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-07 18:57:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-07 18:57:38 -0400
commit7c768c09841d7346444d65721b132d144835fc99 (patch)
tree4402ca6435dd9d6b3831ee8f9fb48d47a5166f82
parent72b54d617006fd5ddce92ee577c52f2bff279310 (diff)
simplify
-rw-r--r--Git.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Git.hs b/Git.hs
index ab43504e1..cd6cdfbfd 100644
--- a/Git.hs
+++ b/Git.hs
@@ -335,10 +335,8 @@ urlHostUser r = urlAuthPart uriUserInfo r ++ urlAuthPart uriRegName' r
{- The full authority portion an URL repo. (ie, "user@host:port") -}
urlAuthority :: Repo -> String
-urlAuthority Repo { location = Url u } = uriUserInfo a ++ uriRegName' a ++ uriPort a
- where
- a = fromMaybe (error $ "bad url " ++ show u) (uriAuthority u)
-urlAuthority repo = assertUrl repo $ error "internal"
+urlAuthority r = flip urlAuthPart r $ \a ->
+ uriUserInfo a ++ uriRegName' a ++ uriPort a
{- Applies a function to extract part of the uriAuthority of an URL repo. -}
urlAuthPart :: (URIAuth -> a) -> Repo -> a