summaryrefslogtreecommitdiff
path: root/Git/Url.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Git/Url.hs')
-rw-r--r--Git/Url.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Git/Url.hs b/Git/Url.hs
index fa7d200..8430655 100644
--- a/Git/Url.hs
+++ b/Git/Url.hs
@@ -2,7 +2,7 @@
-
- Copyright 2010, 2011 Joey Hess <id@joeyh.name>
-
- - Licensed under the GNU GPL version 3 or higher.
+ - Licensed under the GNU AGPL version 3 or higher.
-}
module Git.Url (
@@ -11,9 +11,10 @@ module Git.Url (
port,
hostuser,
authority,
+ path,
) where
-import Network.URI hiding (scheme, authority)
+import Network.URI hiding (scheme, authority, path)
import Common
import Git.Types
@@ -66,6 +67,11 @@ authpart :: (URIAuth -> a) -> Repo -> Maybe a
authpart a Repo { location = Url u } = a <$> uriAuthority u
authpart _ repo = notUrl repo
+{- Path part of an URL repo. -}
+path :: Repo -> FilePath
+path Repo { location = Url u } = uriPath u
+path repo = notUrl repo
+
notUrl :: Repo -> a
notUrl repo = error $
"acting on local git repo " ++ repoDescribe repo ++ " not supported"