diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java index b5a753bbb..2202a91d3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java @@ -822,7 +822,7 @@ public void testALot() throws URISyntaxException { String[] users = new String[] { "me", "l usr\\example.com", "lusr\\example" }; String[] passes = new String[] { "wtf", }; - String[] hosts = new String[] { "example.com", "1.2.3.4" }; + String[] hosts = new String[] { "example.com", "1.2.3.4", "[::1]" }; String[] ports = new String[] { "1234", "80" }; String[] paths = new String[] { "/", "/abc", "D:/x", "D:\\x" }; for (String[] test : tests) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java index 9befb9275..d11edfc63 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java @@ -87,7 +87,7 @@ public class URIish implements Serializable { * Part of a pattern which matches the host part of URIs. Defines one * capturing group containing the host name. */ - private static final String HOST_P = "([^\\\\/:]+)"; //$NON-NLS-1$ + private static final String HOST_P = "((?:[^\\\\/:]+)|(?:\\[[0-9a-f:]+\\]))"; /** * Part of a pattern which matches the optional port part of URIs. Defines