aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/common_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-08-05 09:57:13 +0100
committerGitHub <noreply@github.com>2023-08-05 09:57:13 +0100
commit4ec6b3f4fa9cdfe8f10d0953ac7d398d01a90f17 (patch)
tree3c4598f02b91cbb6374211e088b6e9350c6ac5c1 /plumbing/transport/common_test.go
parent36477e82f22623018ff170af8afc10c2c9bd50c5 (diff)
parenta105da84747df637fa7913c3ab880be73019e502 (diff)
downloadgo-git-4ec6b3f4fa9cdfe8f10d0953ac7d398d01a90f17.tar.gz
Merge pull request #820 from ninedraft/ninedraft/issue740
plumbing: transport, handle IPv6 while parsing endpoint. Fixes #740
Diffstat (limited to 'plumbing/transport/common_test.go')
-rw-r--r--plumbing/transport/common_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/plumbing/transport/common_test.go b/plumbing/transport/common_test.go
index db11303..d9f12ab 100644
--- a/plumbing/transport/common_test.go
+++ b/plumbing/transport/common_test.go
@@ -198,3 +198,15 @@ func (s *SuiteCommon) TestFilterUnsupportedCapabilities(c *C) {
FilterUnsupportedCapabilities(l)
c.Assert(l.Supports(capability.MultiACK), Equals, false)
}
+
+func (s *SuiteCommon) TestNewEndpointIPv6(c *C) {
+ // see issue https://github.com/go-git/go-git/issues/740
+ //
+ // IPv6 host names are not being properly handled, which results in unhelpful
+ // error messages depending on the format used.
+ //
+ e, err := NewEndpoint("http://[::1]:8080/foo.git")
+ c.Assert(err, IsNil)
+ c.Assert(e.Host, Equals, "[::1]")
+ c.Assert(e.String(), Equals, "http://[::1]:8080/foo.git")
+}