summaryrefslogtreecommitdiff
path: root/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-05 14:32:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-05 14:32:20 -0400
commit0b27e6baa0bd6ed61e2369bd5452d61f3e63e545 (patch)
tree8da213ebf32cce2bf251c993d0629be0930f29c8 /Git.hs
parent3e3ed62bdfd3860945e11f648ef7d90c7bacfe98 (diff)
Support unescaped repository urls, like git does.
Turns out that git will accept a .git/config containing an url with eg, spaces in its name. Handle this by escaping the url if it's not valid. This also fixes support for urls containing escaped characters like %20 for space. Before, the path from the url was not unescaped properly.
Diffstat (limited to 'Git.hs')
-rw-r--r--Git.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Git.hs b/Git.hs
index 9420810a6..d8db471e9 100644
--- a/Git.hs
+++ b/Git.hs
@@ -29,7 +29,7 @@ module Git (
import qualified Data.Map as M
import Data.Char
-import Network.URI (uriPath, uriScheme)
+import Network.URI (uriPath, uriScheme, unEscapeString)
import Common
import Git.Types
@@ -107,7 +107,7 @@ gitDir repo
-
- Note that for URL repositories, this is the path on the remote host. -}
workTree :: Repo -> FilePath
-workTree Repo { location = Url u } = uriPath u
+workTree Repo { location = Url u } = unEscapeString $ uriPath u
workTree Repo { location = Dir d } = d
workTree Repo { location = Unknown } = undefined