diff options
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Remote.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Git/Remote.hs b/Git/Remote.hs index 9d969c416..7573c87ee 100644 --- a/Git/Remote.hs +++ b/Git/Remote.hs @@ -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 |