aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-09-10 14:17:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-09-10 14:17:02 -0400
commit5f380c3848c680769986e9b953ee53cbe021ec0c (patch)
tree1101988da144a89f39a1546c72d4103d9f4e83e3
parent9b6bdf5b94fd49c37cc79290912cf81c6fac0b13 (diff)
Fix parsing of ipv6 address in git remote address when it was not formatted as an url.
-rw-r--r--Git/Remote.hs8
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/ssh_over_IPv6.mdwn9
3 files changed, 18 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
diff --git a/debian/changelog b/debian/changelog
index eb917a0b9..fee2a3666 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ git-annex (5.20140832) UNRELEASED; urgency=medium
* init: Automatically detect when a repository was cloned with --shared,
and set annex.hardlink=true, as well as marking the repository as
untrusted.
+ * Fix parsing of ipv6 address in git remote address when it was not
+ formatted as an url.
-- Joey Hess <joeyh@debian.org> Thu, 04 Sep 2014 16:17:22 -0400
diff --git a/doc/bugs/ssh_over_IPv6.mdwn b/doc/bugs/ssh_over_IPv6.mdwn
index d4f2e70f7..b5e9f0358 100644
--- a/doc/bugs/ssh_over_IPv6.mdwn
+++ b/doc/bugs/ssh_over_IPv6.mdwn
@@ -18,3 +18,12 @@ local repository version: 5
supported repository version: 5
upgrade supported from repository versions: 0 1 2 4
```
+
+> [[Fixed|done]] by adding support for ipv6 addresses when git-annex
+> converts a git remote loction into an url. BTW, the
+> simple workaround is to give it a valid url from the beginning
+> `ssh://[fcb8:b10:1cb8:c94:58d0:2522:89f9:c89e]/home/thomas/git/musik"`
+>
+> As to any problems using an ipv6 remote once it's set up, I've used them
+> with no problems.
+> --[[Joey]]