Fix parsing of ipv6 address in git remote address when it was not formatted as an url.
This commit is contained in:
parent
03dae17127
commit
11f111bf1a
3 changed files with 18 additions and 1 deletions
|
@ -102,7 +102,13 @@ parseRemoteLocation s repo = ret $ calcloc s
|
|||
&& not ("::" `isInfixOf` v)
|
||||
scptourl v = "ssh://" ++ host ++ slash dir
|
||||
where
|
||||
(host, dir) = separate (== ':') v
|
||||
(host, dir)
|
||||
-- handle ipv6 address inside []
|
||||
| "[" `isPrefixOf` v = case break (== ']') v of
|
||||
(h, ']':':':d) -> (h ++ "]", d)
|
||||
(h, ']':d) -> (h ++ "]", d)
|
||||
(h, d) -> (h, d)
|
||||
| otherwise = separate (== ':') v
|
||||
slash d | d == "" = "/~/" ++ d
|
||||
| "/" `isPrefixOf` d = d
|
||||
| "~" `isPrefixOf` d = '/':d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue